@@ -264,20 +264,20 @@ let extractExpApplyArgs ~text ~(funName : Longident.t Location.loc) ~args =
264
264
in
265
265
args |> processArgs ~last Offset ~last Pos ~acc: []
266
266
267
- let rec exporToContextPath (e : Parsetree.expression ) =
267
+ let rec exprToContextPath (e : Parsetree.expression ) =
268
268
match e.pexp_desc with
269
269
| Pexp_constant (Pconst_string _ ) -> Some CPString
270
270
| Pexp_array _ -> Some CPArray
271
271
| Pexp_ident {txt} -> Some (CPId (Utils. flattenLongIdent txt, Value ))
272
272
| Pexp_field (e1 , {txt = Lident name } ) -> (
273
- match exporToContextPath e1 with
273
+ match exprToContextPath e1 with
274
274
| Some contextPath -> Some (CPField (contextPath, name))
275
275
| _ -> None )
276
276
| Pexp_field (_ , {txt = Ldot (lid , name )} ) ->
277
277
(* Case x.M.field ignore the x part *)
278
278
Some (CPField (CPId (Utils. flattenLongIdent lid, Module ), name))
279
279
| Pexp_send (e1 , {txt} ) -> (
280
- match exporToContextPath e1 with
280
+ match exprToContextPath e1 with
281
281
| None -> None
282
282
| Some contexPath -> Some (CPObj (contexPath, txt)))
283
283
| _ -> None
@@ -473,7 +473,7 @@ let completionWithParser ~debug ~path ~posCursor ~currentFile ~text =
473
473
(Loc. toString expr.pexp_loc)
474
474
in
475
475
let setPipeResult ~(lhs : Parsetree.expression ) ~id =
476
- match exporToContextPath lhs with
476
+ match exprToContextPath lhs with
477
477
| Some pipe ->
478
478
setResult (Cpath (CPPipe (pipe, id)));
479
479
true
@@ -538,7 +538,7 @@ let completionWithParser ~debug ~path ~posCursor ~currentFile ~text =
538
538
if fieldName.loc |> Loc. hasPos ~pos: posBeforeCursor then
539
539
match fieldName.txt with
540
540
| Lident name -> (
541
- match exporToContextPath e with
541
+ match exprToContextPath e with
542
542
| Some contextPath ->
543
543
let contextPath = CPField (contextPath, name) in
544
544
setResult (Cpath contextPath)
@@ -553,7 +553,7 @@ let completionWithParser ~debug ~path ~posCursor ~currentFile ~text =
553
553
setResult (Cpath contextPath)
554
554
| Lapply _ -> ()
555
555
else if Loc. end_ e.pexp_loc = posBeforeCursor then
556
- match exporToContextPath e with
556
+ match exprToContextPath e with
557
557
| Some contextPath -> setResult (Cpath (CPField (contextPath, " " )))
558
558
| None -> () )
559
559
| Pexp_apply ({pexp_desc = Pexp_ident compName}, args)
@@ -641,7 +641,7 @@ let completionWithParser ~debug ~path ~posCursor ~currentFile ~text =
641
641
labelRange |> Range. hasPos ~pos: posBeforeCursor
642
642
|| (label = " " && posCursor = fst labelRange)
643
643
then
644
- match exporToContextPath lhs with
644
+ match exprToContextPath lhs with
645
645
| Some contextPath -> setResult (Cpath (CPObj (contextPath, label)))
646
646
| None -> () )
647
647
| Pexp_let (recFlag , bindings , e ) ->
0 commit comments