@@ -103,7 +103,7 @@ let hover state ~file ~line ~col ~extra ~package =
103
103
in
104
104
match hoverText with
105
105
| None -> Protocol. null
106
- | Some s -> Protocol. stringifyHover {contents = s} )
106
+ | Some s -> Protocol. stringifyHover {contents = s})
107
107
108
108
let hover ~path ~line ~col =
109
109
let state = TopTypes. empty () in
@@ -124,9 +124,19 @@ let definition state ~file ~line ~col ~extra ~package =
124
124
|> List. filter (fun (l , _ ) -> not l.Location. loc_ghost)
125
125
in
126
126
let pos = Utils. protocolLineColToCmtLoc ~line ~col in
127
+
127
128
match References. locForPos ~extra: {extra with locations} pos with
128
129
| None -> Protocol. null
129
130
| Some (_ , loc ) -> (
131
+ let zzzTODO =
132
+ References. allReferencesForLoc ~paths ForModule:package.pathsForModule
133
+ ~file ~extra ~all Modules:package.localModules
134
+ ~get Uri:(State. fileForUri state)
135
+ ~get Module:(State. fileForModule state ~package )
136
+ ~get Extra:(State. extraForModule state ~package )
137
+ loc
138
+ in
139
+
130
140
let locIsModule =
131
141
match loc with
132
142
| SharedTypes. LModule _ | TopLevelModule _ -> true
@@ -151,7 +161,7 @@ let definition state ~file ~line ~col ~extra ~package =
151
161
if skipZero then Protocol. null
152
162
else
153
163
Protocol. stringifyLocation
154
- {uri = Uri2. toString uri2; range = Utils. cmtLocToRange loc} )
164
+ {uri = Uri2. toString uri2; range = Utils. cmtLocToRange loc})
155
165
156
166
let definition ~path ~line ~col =
157
167
let state = TopTypes. empty () in
@@ -180,22 +190,22 @@ let test ~path =
180
190
let line = i - 1 in
181
191
let col = mlen - 1 in
182
192
if mlen > = 3 then (
183
- ( match String. sub rest 0 3 with
193
+ (match String. sub rest 0 3 with
184
194
| "def" ->
185
195
print_endline
186
- ( " Definition " ^ path ^ " " ^ string_of_int line ^ " :"
187
- ^ string_of_int col );
196
+ (" Definition " ^ path ^ " " ^ string_of_int line ^ " :"
197
+ ^ string_of_int col);
188
198
definition ~path ~line ~col
189
199
| "hov" ->
190
200
print_endline
191
- ( " Hover " ^ path ^ " " ^ string_of_int line ^ " :"
192
- ^ string_of_int col );
201
+ (" Hover " ^ path ^ " " ^ string_of_int line ^ " :"
202
+ ^ string_of_int col);
193
203
194
204
hover ~path ~line ~col
195
205
| "com" ->
196
206
print_endline
197
- ( " Complete " ^ path ^ " " ^ string_of_int line ^ " :"
198
- ^ string_of_int col );
207
+ (" Complete " ^ path ^ " " ^ string_of_int line ^ " :"
208
+ ^ string_of_int col);
199
209
let currentFile, cout = Filename. open_temp_file " def" " txt" in
200
210
lines
201
211
|> List. iteri (fun j l ->
@@ -208,7 +218,7 @@ let test ~path =
208
218
close_out cout;
209
219
complete ~path ~line ~col ~current File;
210
220
Sys. remove currentFile
211
- | _ -> () );
212
- print_newline () )
221
+ | _ -> () );
222
+ print_newline () )
213
223
in
214
224
lines |> List. iteri processLine
0 commit comments