Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit 9d9d290

Browse files
dannypsnljeapostrophe
authored andcommitted
extract WorkspaceEdit
Signed-off-by: Lîm Tsú-thuàn <[email protected]>
1 parent f148226 commit 9d9d290

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

interfaces.rkt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
racket/match
77
"json-util.rkt")
88

9+
(define-json-expander WorkspaceEdit
10+
[changes any/c])
11+
(define-json-expander TextEdit
12+
[range any/c]
13+
[newText string?])
14+
915
(define-json-expander Diagnostic
1016
[range any/c]
1117
[severity (or/c 1 2 3 4)]

text-document.rkt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@
5252
[kind exact-positive-integer?]
5353
[location any/c])
5454

55-
(define-json-expander TextEdit
56-
[range any/c]
57-
[newText string?])
58-
5955
(define-json-expander InlayHint
6056
; must a position `Pos`, defined in interfaces.rkt
6157
[position any/c]
@@ -350,10 +346,11 @@
350346
(cond [req? (json-null)]
351347
[else
352348
(define ranges (cons (start/end->Range doc-text left right) (get-bindings uri decl)))
353-
(hasheq 'changes
354-
(hasheq (string->symbol uri)
355-
(for/list ([range (in-list ranges)])
356-
(TextEdit #:range range #:newText new-name))))])]
349+
(WorkspaceEdit
350+
#:changes
351+
(hasheq (string->symbol uri)
352+
(for/list ([range (in-list ranges)])
353+
(TextEdit #:range range #:newText new-name))))])]
357354
[#f (json-null)]))
358355
(success-response id result)]
359356
[_

0 commit comments

Comments
 (0)