@@ -778,43 +778,21 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
778
778
match contextPath with
779
779
| CPString ->
780
780
if Debug. verbose () then print_endline " [ctx_path]--> CPString" ;
781
- [
782
- Completion. create " dummy" ~env
783
- ~kind:
784
- (Completion. Value
785
- (Ctype. newconstr (Path. Pident (Ident. create " string" )) [] ));
786
- ]
781
+ [Completion. create " dummy" ~env ~kind: (Completion. Value Predef. type_string)]
787
782
| CPBool ->
788
783
if Debug. verbose () then print_endline " [ctx_path]--> CPBool" ;
789
- [
790
- Completion. create " dummy" ~env
791
- ~kind:
792
- (Completion. Value
793
- (Ctype. newconstr (Path. Pident (Ident. create " bool" )) [] ));
794
- ]
784
+ [Completion. create " dummy" ~env ~kind: (Completion. Value Predef. type_bool)]
795
785
| CPInt ->
796
786
if Debug. verbose () then print_endline " [ctx_path]--> CPInt" ;
797
- [
798
- Completion. create " dummy" ~env
799
- ~kind:
800
- (Completion. Value
801
- (Ctype. newconstr (Path. Pident (Ident. create " int" )) [] ));
802
- ]
787
+ [Completion. create " dummy" ~env ~kind: (Completion. Value Predef. type_int)]
803
788
| CPFloat ->
804
789
if Debug. verbose () then print_endline " [ctx_path]--> CPFloat" ;
805
- [
806
- Completion. create " dummy" ~env
807
- ~kind:
808
- (Completion. Value
809
- (Ctype. newconstr (Path. Pident (Ident. create " float" )) [] ));
810
- ]
790
+ [Completion. create " dummy" ~env ~kind: (Completion. Value Predef. type_float)]
811
791
| CPArray None ->
812
792
if Debug. verbose () then print_endline " [ctx_path]--> CPArray (no payload)" ;
813
793
[
814
794
Completion. create " array" ~env
815
- ~kind:
816
- (Completion. Value
817
- (Ctype. newconstr (Path. Pident (Ident. create " array" )) [] ));
795
+ ~kind: (Completion. Value (Ctype. newconstr Predef. path_array [] ));
818
796
]
819
797
| CPArray (Some cp ) -> (
820
798
if Debug. verbose () then
@@ -839,9 +817,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
839
817
what inner type it has. *)
840
818
[
841
819
Completion. create " dummy" ~env
842
- ~kind:
843
- (Completion. Value
844
- (Ctype. newconstr (Path. Pident (Ident. create " array" )) [] ));
820
+ ~kind: (Completion. Value (Ctype. newconstr Predef. path_array [] ));
845
821
])
846
822
| CPOption cp -> (
847
823
if Debug. verbose () then print_endline " [ctx_path]--> CPOption" ;
@@ -1722,9 +1698,7 @@ let rec completeTypedValue ?(typeArgContext : typeArgContext option) ~rawOpens
1722
1698
if prefix = " " then
1723
1699
[
1724
1700
create " \"\" " ~includes Snippets:true ~insert Text:" \" $0\" " ~sort Text:" A"
1725
- ~kind:
1726
- (Value (Ctype. newconstr (Path. Pident (Ident. create " string" )) [] ))
1727
- ~env ;
1701
+ ~kind: (Value Predef. type_string) ~env ;
1728
1702
]
1729
1703
else []
1730
1704
| Tfunction {env; typ; args; returnType} when prefix = " " && mode = Expression
@@ -1912,7 +1886,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1912
1886
stamp = - 1 ;
1913
1887
fname = {loc = Location. none; txt = name};
1914
1888
optional = true ;
1915
- typ = Ctype. newconstr ( Path. Pident ( Ident. create primitive)) [] ;
1889
+ typ = Ctype. newconstr primitive [] ;
1916
1890
docstring = [] ;
1917
1891
deprecated = None ;
1918
1892
}
@@ -1924,9 +1898,9 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1924
1898
definition = `NameOnly " jsxConfig" ;
1925
1899
fields =
1926
1900
[
1927
- mkField ~name: " version" ~primitive: " int " ;
1928
- mkField ~name: " module_" ~primitive: " string " ;
1929
- mkField ~name: " mode" ~primitive: " string " ;
1901
+ mkField ~name: " version" ~primitive: Predef. path_int ;
1902
+ mkField ~name: " module_" ~primitive: Predef. path_string ;
1903
+ mkField ~name: " mode" ~primitive: Predef. path_string ;
1930
1904
];
1931
1905
}
1932
1906
in
@@ -1942,7 +1916,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1942
1916
stamp = - 1 ;
1943
1917
fname = {loc = Location. none; txt = name};
1944
1918
optional = true ;
1945
- typ = Ctype. newconstr ( Path. Pident ( Ident. create primitive)) [] ;
1919
+ typ = Ctype. newconstr primitive [] ;
1946
1920
docstring = [] ;
1947
1921
deprecated = None ;
1948
1922
}
@@ -1952,7 +1926,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1952
1926
{
1953
1927
env;
1954
1928
definition = `NameOnly " importAttributesConfig" ;
1955
- fields = [mkField ~name: " type_" ~primitive: " string " ];
1929
+ fields = [mkField ~name: " type_" ~primitive: Predef. path_string ];
1956
1930
}
1957
1931
in
1958
1932
let rootConfig : completionType =
@@ -1962,8 +1936,8 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1962
1936
definition = `NameOnly " moduleConfig" ;
1963
1937
fields =
1964
1938
[
1965
- mkField ~name: " from" ~primitive: " string " ;
1966
- mkField ~name: " with" ~primitive: " string " ;
1939
+ mkField ~name: " from" ~primitive: Predef. path_string ;
1940
+ mkField ~name: " with" ~primitive: Predef. path_string ;
1967
1941
];
1968
1942
}
1969
1943
in
0 commit comments