@@ -828,41 +828,31 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
828828 if Debug. verbose () then print_endline " [ctx_path]--> CPString" ;
829829 [
830830 Completion. create " dummy" ~env
831- ~kind:
832- (Completion. Value
833- (Ctype. newconstr (Path. Pident (Ident. create " string" )) [] ));
831+ ~kind: (Completion. Value (Ctype. newconstr Predef. path_string [] ));
834832 ]
835833 | CPBool ->
836834 if Debug. verbose () then print_endline " [ctx_path]--> CPBool" ;
837835 [
838836 Completion. create " dummy" ~env
839- ~kind:
840- (Completion. Value
841- (Ctype. newconstr (Path. Pident (Ident. create " bool" )) [] ));
837+ ~kind: (Completion. Value (Ctype. newconstr Predef. path_bool [] ));
842838 ]
843839 | CPInt ->
844840 if Debug. verbose () then print_endline " [ctx_path]--> CPInt" ;
845841 [
846842 Completion. create " dummy" ~env
847- ~kind:
848- (Completion. Value
849- (Ctype. newconstr (Path. Pident (Ident. create " int" )) [] ));
843+ ~kind: (Completion. Value (Ctype. newconstr Predef. path_int [] ));
850844 ]
851845 | CPFloat ->
852846 if Debug. verbose () then print_endline " [ctx_path]--> CPFloat" ;
853847 [
854848 Completion. create " dummy" ~env
855- ~kind:
856- (Completion. Value
857- (Ctype. newconstr (Path. Pident (Ident. create " float" )) [] ));
849+ ~kind: (Completion. Value (Ctype. newconstr Predef. path_float [] ));
858850 ]
859851 | CPArray None ->
860852 if Debug. verbose () then print_endline " [ctx_path]--> CPArray (no payload)" ;
861853 [
862854 Completion. create " array" ~env
863- ~kind:
864- (Completion. Value
865- (Ctype. newconstr (Path. Pident (Ident. create " array" )) [] ));
855+ ~kind: (Completion. Value (Ctype. newconstr Predef. path_array [] ));
866856 ]
867857 | CPArray (Some cp ) -> (
868858 if Debug. verbose () then
@@ -887,9 +877,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
887877 what inner type it has. *)
888878 [
889879 Completion. create " dummy" ~env
890- ~kind:
891- (Completion. Value
892- (Ctype. newconstr (Path. Pident (Ident. create " array" )) [] ));
880+ ~kind: (Completion. Value (Ctype. newconstr Predef. path_array [] ));
893881 ])
894882 | CPOption cp -> (
895883 if Debug. verbose () then print_endline " [ctx_path]--> CPOption" ;
@@ -1135,6 +1123,10 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
11351123 (QueryEnv. toString env)
11361124 (QueryEnv. toString envFromCompletionItem)
11371125 else Printf. printf " CPPipe env:%s\n " (QueryEnv. toString env);
1126+ let tPath =
1127+ match typ with
1128+ | Builtin (_ , t ) | TypExpr t -> TypeUtils. pathFromTypeExpr t
1129+ in
11381130 let completionPath =
11391131 match typ with
11401132 | Builtin (builtin , _ ) ->
@@ -1186,13 +1178,15 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
11861178 completionsForPipeFromCompletionPath ~env CompletionIsMadeFrom ~opens
11871179 ~pos ~scope ~debug ~prefix: funNamePrefix ~env ~raw Opens ~full
11881180 completionPath
1181+ |> TypeUtils. filterPipeableFunctions ~env ~full ?path:tPath
11891182 in
11901183 match completionPath with
11911184 | Some completionPath -> (
11921185 let completionsFromMainFn =
11931186 completionsForPipeFromCompletionPath ~env CompletionIsMadeFrom ~opens
11941187 ~pos ~scope ~debug ~prefix: funNamePrefix ~env ~raw Opens ~full
11951188 completionPath
1189+ |> TypeUtils. filterPipeableFunctions ~env ~full ?path:tPath
11961190 in
11971191 let completions = completionsFromMainFn @ completionsFromExtraModule in
11981192 (* We add React element functions to the completion if we're in a JSX context *)
@@ -1822,8 +1816,7 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens
18221816 if prefix = " " then
18231817 [
18241818 create " \"\" " ~includes Snippets:true ~insert Text:" \" $0\" " ~sort Text:" A"
1825- ~kind:
1826- (Value (Ctype. newconstr (Path. Pident (Ident. create " string" )) [] ))
1819+ ~kind: (Value (Ctype. newconstr Predef. path_string [] ))
18271820 ~env ;
18281821 ]
18291822 else []
@@ -2012,7 +2005,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
20122005 stamp = - 1 ;
20132006 fname = {loc = Location. none; txt = name};
20142007 optional = true ;
2015- typ = Ctype. newconstr ( Path. Pident ( Ident. create primitive)) [] ;
2008+ typ = Ctype. newconstr primitive [] ;
20162009 docstring = [] ;
20172010 deprecated = None ;
20182011 }
@@ -2026,9 +2019,9 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
20262019 attributes = [] ;
20272020 fields =
20282021 [
2029- mkField ~name: " version" ~primitive: " int " ;
2030- mkField ~name: " module_" ~primitive: " string " ;
2031- mkField ~name: " mode" ~primitive: " string " ;
2022+ mkField ~name: " version" ~primitive: Predef. path_int ;
2023+ mkField ~name: " module_" ~primitive: Predef. path_string ;
2024+ mkField ~name: " mode" ~primitive: Predef. path_string ;
20322025 ];
20332026 }
20342027 in
@@ -2044,7 +2037,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
20442037 stamp = - 1 ;
20452038 fname = {loc = Location. none; txt = name};
20462039 optional = true ;
2047- typ = Ctype. newconstr ( Path. Pident ( Ident. create primitive)) [] ;
2040+ typ = Ctype. newconstr primitive [] ;
20482041 docstring = [] ;
20492042 deprecated = None ;
20502043 }
@@ -2056,7 +2049,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
20562049 path = None ;
20572050 attributes = [] ;
20582051 definition = `NameOnly " importAttributesConfig" ;
2059- fields = [mkField ~name: " type_" ~primitive: " string " ];
2052+ fields = [mkField ~name: " type_" ~primitive: Predef. path_string ];
20602053 }
20612054 in
20622055 let rootConfig : completionType =
@@ -2068,8 +2061,8 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
20682061 definition = `NameOnly " moduleConfig" ;
20692062 fields =
20702063 [
2071- mkField ~name: " from" ~primitive: " string " ;
2072- mkField ~name: " with" ~primitive: " string " ;
2064+ mkField ~name: " from" ~primitive: Predef. path_string ;
2065+ mkField ~name: " with" ~primitive: Predef. path_string ;
20732066 ];
20742067 }
20752068 in
0 commit comments