File tree 2 files changed +13
-14
lines changed
2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -137,16 +137,9 @@ let command ~path =
137
137
let result =
138
138
! symbols
139
139
|> List. rev_map (fun (name , loc , kind ) ->
140
+ let range = Utils. cmtLocToRange loc in
140
141
Protocol. stringifyDocumentSymbolItem
141
- {
142
- name;
143
- location =
144
- {
145
- uri = Uri. toString (Uri. fromPath path);
146
- range = Utils. cmtLocToRange loc;
147
- };
148
- kind = kindNumber kind;
149
- })
142
+ {name; range; selectionRange = range; kind = kindNumber kind})
150
143
|> String. concat " ,\n "
151
144
in
152
145
print_endline (" [\n " ^ result ^ " \n ]" )
Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ type completionItem = {
42
42
}
43
43
44
44
type location = {uri : string ; range : range }
45
- type documentSymbolItem = {name : string ; kind : int ; location : location }
45
+ type documentSymbolItem = {
46
+ name : string ;
47
+ kind : int ;
48
+ range : range ;
49
+ selectionRange : range ;
50
+ }
46
51
type renameFile = {oldUri : string ; newUri : string }
47
52
type textEdit = {range : range ; newText : string }
48
53
@@ -103,15 +108,16 @@ let stringifyLocation (h : location) =
103
108
Printf. sprintf {| {" uri" : " %s" , " range" : % s}| } (Json. escape h.uri)
104
109
(stringifyRange h.range)
105
110
106
- let stringifyDocumentSymbolItem i =
111
+ let stringifyDocumentSymbolItem (i : documentSymbolItem ) =
112
+ let range = stringifyRange i.range in
107
113
Printf. sprintf
108
114
{| {
109
115
" name" : " %s" ,
110
116
" kind" : % i,
111
- " location" : % s
117
+ " range" : % s,
118
+ " selectionRange" : % s
112
119
}| }
113
- (Json. escape i.name) i.kind
114
- (stringifyLocation i.location)
120
+ (Json. escape i.name) i.kind range range
115
121
116
122
let stringifyRenameFile {oldUri; newUri} =
117
123
Printf. sprintf {| {
You can’t perform that action at this time.
0 commit comments