@@ -27,16 +27,18 @@ let locItemForPos ~full pos =
27
27
| _ :: _ :: _ :: l :: _ when full.file.uri |> Uri2. isInterface ->
28
28
(* heuristic for makeProps in interface files *)
29
29
Some l
30
- | [({locType = Typed (_, LocalReference _)} as li1); li3]
30
+ | [({locType = Typed (_, _, LocalReference _)} as li1); li3]
31
31
when li1.loc = li3.loc ->
32
32
(* JSX and compiler combined:
33
33
~x becomes Props#x
34
34
heuristic for: [Props, x], give loc of `x` *)
35
35
Some li3
36
36
| [
37
- ({locType = Typed (_, LocalReference _)} as li1);
38
- ({locType = Typed (_, GlobalReference (" Js_OO" , Tip " unsafe_downgrade" , _))}
39
- as li2);
37
+ ({locType = Typed (_, _, LocalReference _)} as li1);
38
+ ({
39
+ locType =
40
+ Typed (_, _, GlobalReference (" Js_OO" , Tip " unsafe_downgrade" , _));
41
+ } as li2);
40
42
li3;
41
43
]
42
44
(* For older compiler 9.0 or earlier *)
@@ -46,8 +48,8 @@ let locItemForPos ~full pos =
46
48
heuristic for: [Props, unsafe_downgrade, x], give loc of `x` *)
47
49
Some li3
48
50
| [
49
- {locType = Typed (_, LocalReference (_, Value ))};
50
- ({locType = Typed (_, Definition (_, Value ))} as li2);
51
+ {locType = Typed (_, _, LocalReference (_, Value ))};
52
+ ({locType = Typed (_, _, Definition (_, Value ))} as li2);
51
53
] ->
52
54
(* JSX on type-annotated labeled (~arg:t):
53
55
(~arg:t) becomes Props#arg
@@ -297,7 +299,7 @@ let orLog message v =
297
299
298
300
let definitionForLocItem ~full :{file; package} locItem =
299
301
match locItem.locType with
300
- | Typed (_ , Definition (stamp , tip )) -> (
302
+ | Typed (_ , _ , Definition (stamp , tip )) -> (
301
303
maybeLog " Trying to find a defintion for a definition" ;
302
304
match declaredForTip ~stamps: file.stamps stamp tip with
303
305
| None -> None
@@ -311,7 +313,7 @@ let definitionForLocItem ~full:{file; package} locItem =
311
313
let loc = validateLoc declared.name.loc declared.extentLoc in
312
314
Some (file.uri, loc))
313
315
else None )
314
- | Typed (_, NotFound )
316
+ | Typed (_, _, NotFound )
315
317
| LModule (NotFound | Definition (_, _))
316
318
| TypeDefinition (_, _, _)
317
319
| Constant _ ->
@@ -326,11 +328,11 @@ let definitionForLocItem ~full:{file; package} locItem =
326
328
| None -> None
327
329
| Some src -> Some (Uri2. fromPath src, Utils. topLoc src))
328
330
| LModule (LocalReference (stamp, tip))
329
- | Typed (_ , LocalReference (stamp , tip )) ->
331
+ | Typed (_ , _ , LocalReference (stamp , tip )) ->
330
332
maybeLog (" Local defn " ^ tipToString tip);
331
333
definition ~file ~package stamp tip
332
334
| LModule (GlobalReference (moduleName, path, tip))
333
- | Typed (_ , GlobalReference (moduleName , path , tip )) -> (
335
+ | Typed (_ , _ , GlobalReference (moduleName , path , tip )) -> (
334
336
maybeLog
335
337
(" Global defn " ^ moduleName ^ " " ^ pathToString path ^ " : "
336
338
^ tipToString tip);
@@ -450,16 +452,17 @@ let forLocalStamp ~full:{file; extra; package} stamp tip =
450
452
451
453
let allReferencesForLocItem ~full :({file; package} as full ) locItem =
452
454
match locItem.locType with
453
- | Typed (_ , NotFound ) | LModule NotFound | TopLevelModule _ | Constant _ -> []
455
+ | Typed (_ , _ , NotFound ) | LModule NotFound | TopLevelModule _ | Constant _ ->
456
+ []
454
457
| TypeDefinition (_ , _ , stamp ) -> forLocalStamp ~full stamp Type
455
- | Typed (_, (LocalReference (stamp, tip) | Definition (stamp, tip)))
458
+ | Typed (_, _, (LocalReference (stamp, tip) | Definition (stamp, tip)))
456
459
| LModule (LocalReference (stamp , tip ) | Definition (stamp , tip )) ->
457
460
maybeLog
458
461
(" Finding references for " ^ Uri2. toString file.uri ^ " and stamp "
459
462
^ string_of_int stamp ^ " and tip " ^ tipToString tip);
460
463
forLocalStamp ~full stamp tip
461
464
| LModule (GlobalReference (moduleName, path, tip))
462
- | Typed (_ , GlobalReference (moduleName , path , tip )) -> (
465
+ | Typed (_ , _ , GlobalReference (moduleName , path , tip )) -> (
463
466
match ProcessCmt. fileForModule ~package moduleName with
464
467
| None -> []
465
468
| Some file -> (
0 commit comments