@@ -263,7 +263,7 @@ let findAllCompletions ~(env : QueryEnv.t) ~prefix ~exact ~namesUsed
263
263
completionForExportedFields ~env ~prefix ~exact ~names Used
264
264
@ completionForExportedModules ~env ~prefix ~exact ~names Used
265
265
266
- let processLocalValue name loc contextPath ~prefix ~exact ~env
266
+ let processLocalValue name loc contextPath scope ~prefix ~exact ~env
267
267
~(localTables : LocalTables.t ) =
268
268
if Utils. checkName name ~prefix ~exact then
269
269
match Hashtbl. find_opt localTables.valueTable (name, Loc. start loc) with
@@ -279,14 +279,14 @@ let processLocalValue name loc contextPath ~prefix ~exact ~env
279
279
}
280
280
:: localTables.resultRev)
281
281
| None ->
282
- Log. log
283
- ( Printf. sprintf " Completion Value Not Found %s loc:%s\n " name
284
- (Loc. toString loc) );
282
+ if ! Cfg. debugFollowCtxPath then
283
+ Printf. printf " Completion Value Not Found %s loc:%s\n " name
284
+ (Loc. toString loc);
285
285
localTables.resultRev < -
286
286
Completion. create name ~env
287
287
~kind:
288
288
(match contextPath with
289
- | Some contextPath -> FollowContextPath contextPath
289
+ | Some contextPath -> FollowContextPath ( contextPath, scope)
290
290
| None ->
291
291
Value
292
292
(Ctype. newconstr
@@ -622,17 +622,17 @@ let completionsGetCompletionType ~full = function
622
622
| {Completion. kind = ExtractedType (typ , _ ); env} :: _ -> Some (typ, env)
623
623
| _ -> None
624
624
625
- let rec completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos ~ scope
626
- = function
625
+ let rec completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos =
626
+ function
627
627
| {Completion. kind = Value typ; env} :: _
628
628
| {Completion. kind = ObjLabel typ; env} :: _
629
629
| {Completion. kind = Field ({typ} , _ ); env} :: _ ->
630
630
Some (TypeExpr typ, env)
631
- | {Completion. kind = FollowContextPath ctxPath ; env} :: _ ->
631
+ | {Completion. kind = FollowContextPath ( ctxPath , scope ) ; env} :: _ ->
632
632
ctxPath
633
633
|> getCompletionsForContextPath ~debug ~full ~env ~exact: true ~opens
634
634
~raw Opens ~pos ~scope
635
- |> completionsGetCompletionType2 ~debug ~full ~opens ~raw Opens ~pos ~scope
635
+ |> completionsGetCompletionType2 ~debug ~full ~opens ~raw Opens ~pos
636
636
| {Completion. kind = Type typ ; env} :: _ -> (
637
637
match TypeUtils. extractTypeFromResolvedType typ ~env ~full with
638
638
| None -> None
@@ -642,16 +642,16 @@ let rec completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos ~scope
642
642
| _ -> None
643
643
644
644
and completionsGetTypeEnv2 ~debug (completions : Completion.t list ) ~full ~opens
645
- ~rawOpens ~pos ~ scope =
645
+ ~rawOpens ~pos =
646
646
match completions with
647
647
| {Completion. kind = Value typ ; env} :: _ -> Some (typ, env)
648
648
| {Completion. kind = ObjLabel typ ; env} :: _ -> Some (typ, env)
649
649
| {Completion. kind = Field ({typ} , _ ); env} :: _ -> Some (typ, env)
650
- | {Completion. kind = FollowContextPath ctxPath ; env} :: _ ->
650
+ | {Completion. kind = FollowContextPath ( ctxPath , scope ) ; env} :: _ ->
651
651
ctxPath
652
652
|> getCompletionsForContextPath ~debug ~full ~opens ~raw Opens ~pos ~env
653
653
~exact: true ~scope
654
- |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos ~scope
654
+ |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos
655
655
| _ -> None
656
656
657
657
and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
@@ -754,7 +754,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
754
754
cp
755
755
|> getCompletionsForContextPath ~debug ~full ~opens ~raw Opens ~pos ~env
756
756
~exact: true ~scope
757
- |> completionsGetCompletionType2 ~debug ~full ~opens ~raw Opens ~pos ~scope
757
+ |> completionsGetCompletionType2 ~debug ~full ~opens ~raw Opens ~pos
758
758
with
759
759
| Some ((TypeExpr typ | ExtractedType (Tfunction {typ} )), env ) -> (
760
760
let rec reconstructFunctionType args tRet =
@@ -805,7 +805,6 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
805
805
match
806
806
completionsForCtxPath
807
807
|> completionsGetCompletionType2 ~debug ~full ~opens ~raw Opens ~pos
808
- ~scope
809
808
with
810
809
| Some (TypeExpr typ , env ) -> (
811
810
match typ |> TypeUtils. extractRecordType ~env ~package with
@@ -839,7 +838,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
839
838
cp
840
839
|> getCompletionsForContextPath ~debug ~full ~opens ~raw Opens ~pos ~env
841
840
~exact: true ~scope
842
- |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos ~scope
841
+ |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos
843
842
with
844
843
| Some (typ , env ) -> (
845
844
match typ |> TypeUtils. extractObjectType ~env ~package with
@@ -866,7 +865,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
866
865
cp
867
866
|> getCompletionsForContextPath ~debug ~full ~opens ~raw Opens ~pos ~env
868
867
~exact: true ~scope ~mode: Pipe
869
- |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos ~scope
868
+ |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos
870
869
with
871
870
| None -> []
872
871
| Some (typ , envFromCompletionItem ) -> (
@@ -1031,7 +1030,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
1031
1030
path
1032
1031
|> getCompletionsForPath ~debug ~completion Context:Value ~exact: true
1033
1032
~package ~opens ~full ~pos ~env ~scope
1034
- |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos ~scope
1033
+ |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos
1035
1034
in
1036
1035
let lowercaseComponent =
1037
1036
match pathToComponent with
@@ -1078,7 +1077,6 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
1078
1077
|> getCompletionsForContextPath ~debug ~full ~opens ~raw Opens ~pos ~env
1079
1078
~exact: true ~scope
1080
1079
|> completionsGetCompletionType2 ~debug ~full ~opens ~raw Opens ~pos
1081
- ~scope
1082
1080
with
1083
1081
| Some ((TypeExpr typ | ExtractedType (Tfunction {typ} )), env ) ->
1084
1082
(typ |> TypeUtils. getArgs ~full ~env , env)
@@ -1115,7 +1113,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
1115
1113
rootCtxPath
1116
1114
|> getCompletionsForContextPath ~debug ~full ~opens ~raw Opens ~pos ~env
1117
1115
~exact: true ~scope
1118
- |> completionsGetCompletionType2 ~debug ~full ~opens ~raw Opens ~pos ~scope
1116
+ |> completionsGetCompletionType2 ~debug ~full ~opens ~raw Opens ~pos
1119
1117
with
1120
1118
| Some (typ , env ) -> (
1121
1119
match typ |> TypeUtils. resolveNestedPatternPath ~env ~full ~nested with
@@ -1528,7 +1526,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1528
1526
path
1529
1527
|> getCompletionsForPath ~debug ~completion Context:Value ~exact: true
1530
1528
~package ~opens ~full ~pos ~env ~scope
1531
- |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos ~scope
1529
+ |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos
1532
1530
in
1533
1531
match completable with
1534
1532
| Cnone -> []
@@ -1603,7 +1601,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1603
1601
cp
1604
1602
|> getCompletionsForContextPath ~debug ~full ~opens ~raw Opens ~pos ~env
1605
1603
~exact: true ~scope
1606
- |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos ~scope
1604
+ |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos
1607
1605
with
1608
1606
| Some (typ , _env ) ->
1609
1607
if debug then
@@ -1639,7 +1637,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1639
1637
contextPath
1640
1638
|> getCompletionsForContextPath ~debug ~full ~opens ~raw Opens ~pos ~env
1641
1639
~exact: true ~scope
1642
- |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos ~scope
1640
+ |> completionsGetTypeEnv2 ~debug ~full ~opens ~raw Opens ~pos
1643
1641
with
1644
1642
| Some (typ , env ) -> (
1645
1643
match
0 commit comments