Skip to content

Commit bb0c9ed

Browse files
committed
Make heuristic for makeProps in interface files more precise.
1 parent 427426b commit bb0c9ed

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

analysis/src/References.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ let locItemForPos ~full pos =
2424
("locItems:\n"
2525
^ (locItems |> List.map locItemToString |> String.concat "\n"));
2626
match locItems with
27-
| _ :: _ :: _ :: l :: _ when full.file.uri |> Uri2.isInterface ->
27+
| _ :: _ :: _ :: ({locType = Typed ("makeProps", _, _)} as l) :: _
28+
when full.file.uri |> Uri2.isInterface ->
2829
(* heuristic for makeProps in interface files *)
2930
Some l
3031
| [
@@ -67,9 +68,6 @@ let locItemForPos ~full pos =
6768
Props has the location range of arg:t
6869
arg has the location range of arg
6970
heuristic for: [Props, arg], give loc of `arg` *)
70-
(* Printf.eprintf "l1 %s\nl2 %s\n"
71-
(SharedTypes.locationToString _l1)
72-
(SharedTypes.locationToString l2); *)
7371
Some li2
7472
| [li1; li2; li3] when li1.loc = li2.loc && li2.loc = li3.loc ->
7573
(* JSX with at most one child

0 commit comments

Comments
 (0)