@@ -558,7 +558,8 @@ let completionForExporteds iterExported getDeclared ~prefix ~exact ~env
558
558
res :=
559
559
{
560
560
(Completion. create ~name: declared.name.txt ~env
561
- ~kind: (transformContents declared.item))
561
+ ~kind: (transformContents declared.item)
562
+ () )
562
563
with
563
564
deprecated = declared.deprecated;
564
565
docstring = declared.docstring;
@@ -600,7 +601,8 @@ let completionsForExportedConstructors ~(env : QueryEnv.t) ~prefix ~exact
600
601
(Completion. create ~name ~env
601
602
~kind:
602
603
(Completion. Constructor
603
- (c, t.item.decl |> Shared. declToString t.name.txt)))
604
+ (c, t.item.decl |> Shared. declToString t.name.txt))
605
+ () )
604
606
else None ))
605
607
@ ! res
606
608
| _ -> () );
@@ -619,10 +621,11 @@ let completionForExportedFields ~(env : QueryEnv.t) ~prefix ~exact ~namesUsed =
619
621
if not (Hashtbl. mem namesUsed name) then
620
622
let () = Hashtbl. add namesUsed name () in
621
623
Some
622
- (Completion. create ~name ~env
624
+ (Completion. create ~name ~env ~docstring: f.docstring
623
625
~kind:
624
626
(Completion. Field
625
- (f, t.item.decl |> Shared. declToString t.name.txt)))
627
+ (f, t.item.decl |> Shared. declToString t.name.txt))
628
+ () )
626
629
else None ))
627
630
@ ! res
628
631
| _ -> () );
@@ -801,7 +804,7 @@ let processLocalValue name loc ~prefix ~exact ~env
801
804
localTables.resultRev < -
802
805
{
803
806
(Completion. create ~name: declared.name.txt ~env
804
- ~kind: (Value declared.item))
807
+ ~kind: (Value declared.item) () )
805
808
with
806
809
deprecated = declared.deprecated;
807
810
docstring = declared.docstring;
@@ -818,6 +821,7 @@ let processLocalValue name loc ~prefix ~exact ~env
818
821
(Ctype. newconstr
819
822
(Path. Pident (Ident. create " Type Not Known" ))
820
823
[] ))
824
+ ()
821
825
:: localTables.resultRev
822
826
823
827
let processLocalConstructor name loc ~prefix ~exact ~env
@@ -836,7 +840,8 @@ let processLocalConstructor name loc ~prefix ~exact ~env
836
840
(Constructor
837
841
( declared.item,
838
842
snd declared.item.typeDecl
839
- |> Shared. declToString (fst declared.item.typeDecl) )))
843
+ |> Shared. declToString (fst declared.item.typeDecl) ))
844
+ () )
840
845
with
841
846
deprecated = declared.deprecated;
842
847
docstring = declared.docstring;
@@ -857,7 +862,7 @@ let processLocalType name loc ~prefix ~exact ~env ~(localTables : LocalTables.t)
857
862
localTables.resultRev < -
858
863
{
859
864
(Completion. create ~name: declared.name.txt ~env
860
- ~kind: (Type declared.item))
865
+ ~kind: (Type declared.item) () )
861
866
with
862
867
deprecated = declared.deprecated;
863
868
docstring = declared.docstring;
@@ -878,7 +883,7 @@ let processLocalModule name loc ~prefix ~exact ~env
878
883
localTables.resultRev < -
879
884
{
880
885
(Completion. create ~name: declared.name.txt ~env
881
- ~kind: (Module declared.item))
886
+ ~kind: (Module declared.item) () )
882
887
with
883
888
deprecated = declared.deprecated;
884
889
docstring = declared.docstring;
@@ -1139,7 +1144,8 @@ let getComplementaryCompletionsForTypedValue ~opens ~allFiles ~scope ~env prefix
1139
1144
(String. contains name '-' )
1140
1145
then
1141
1146
Some
1142
- (Completion. create ~name ~env ~kind: (Completion. FileModule name))
1147
+ (Completion. create ~name ~env ~kind: (Completion. FileModule name)
1148
+ () )
1143
1149
else None )
1144
1150
in
1145
1151
localCompletionsWithOpens @ fileModules
@@ -1164,7 +1170,7 @@ let getCompletionsForPath ~package ~opens ~allFiles ~pos ~exact ~scope
1164
1170
then
1165
1171
Some
1166
1172
(Completion. create ~name ~env
1167
- ~kind: (Completion. FileModule name))
1173
+ ~kind: (Completion. FileModule name) () )
1168
1174
else None )
1169
1175
in
1170
1176
localCompletionsWithOpens @ fileModules
@@ -1353,28 +1359,32 @@ let rec getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1353
1359
Completion. create ~name: " string" ~env
1354
1360
~kind:
1355
1361
(Completion. Value
1356
- (Ctype. newconstr (Path. Pident (Ident. create " string" )) [] ));
1362
+ (Ctype. newconstr (Path. Pident (Ident. create " string" )) [] ))
1363
+ () ;
1357
1364
]
1358
1365
| CPInt ->
1359
1366
[
1360
1367
Completion. create ~name: " int" ~env
1361
1368
~kind:
1362
1369
(Completion. Value
1363
- (Ctype. newconstr (Path. Pident (Ident. create " int" )) [] ));
1370
+ (Ctype. newconstr (Path. Pident (Ident. create " int" )) [] ))
1371
+ () ;
1364
1372
]
1365
1373
| CPFloat ->
1366
1374
[
1367
1375
Completion. create ~name: " float" ~env
1368
1376
~kind:
1369
1377
(Completion. Value
1370
- (Ctype. newconstr (Path. Pident (Ident. create " float" )) [] ));
1378
+ (Ctype. newconstr (Path. Pident (Ident. create " float" )) [] ))
1379
+ () ;
1371
1380
]
1372
1381
| CPArray ->
1373
1382
[
1374
1383
Completion. create ~name: " array" ~env
1375
1384
~kind:
1376
1385
(Completion. Value
1377
- (Ctype. newconstr (Path. Pident (Ident. create " array" )) [] ));
1386
+ (Ctype. newconstr (Path. Pident (Ident. create " array" )) [] ))
1387
+ () ;
1378
1388
]
1379
1389
| CPId (path , completionContext ) ->
1380
1390
path
@@ -1418,7 +1428,10 @@ let rec getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1418
1428
| args , tRet when args <> [] ->
1419
1429
let args = processApply args labels in
1420
1430
let retType = reconstructFunctionType args tRet in
1421
- [Completion. create ~name: " dummy" ~env ~kind: (Completion. Value retType)]
1431
+ [
1432
+ Completion. create ~name: " dummy" ~env ~kind: (Completion. Value retType)
1433
+ () ;
1434
+ ]
1422
1435
| _ -> [] )
1423
1436
| None -> [])
1424
1437
| CPField (CPId (path , Module), fieldName ) ->
@@ -1441,11 +1454,13 @@ let rec getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1441
1454
if checkName field.fname.txt ~prefix: fieldName ~exact then
1442
1455
Some
1443
1456
(Completion. create ~name: field.fname.txt ~env
1457
+ ~docstring: field.docstring
1444
1458
~kind:
1445
1459
(Completion. Field
1446
1460
( field,
1447
1461
typDecl.item.decl
1448
- |> Shared. declToString typDecl.name.txt )))
1462
+ |> Shared. declToString typDecl.name.txt ))
1463
+ () )
1449
1464
else None )
1450
1465
| None -> [] )
1451
1466
| None -> [] )
@@ -1473,7 +1488,7 @@ let rec getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1473
1488
if checkName field ~prefix: label ~exact then
1474
1489
Some
1475
1490
(Completion. create ~name: field ~env
1476
- ~kind: (Completion. ObjLabel typ))
1491
+ ~kind: (Completion. ObjLabel typ) () )
1477
1492
else None )
1478
1493
| None -> [] )
1479
1494
| None -> [] )
@@ -1656,7 +1671,8 @@ let rec getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1656
1671
if List. length ctxPaths = List. length typeExrps then
1657
1672
[
1658
1673
Completion. create ~name: " dummy" ~env
1659
- ~kind: (Completion. Value (Ctype. newty (Ttuple typeExrps)));
1674
+ ~kind: (Completion. Value (Ctype. newty (Ttuple typeExrps)))
1675
+ () ;
1660
1676
]
1661
1677
else []
1662
1678
| CJsxPropValue {pathToComponent; propName} -> (
@@ -1675,7 +1691,8 @@ let rec getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1675
1691
| Some (_ , typ , env ) ->
1676
1692
[
1677
1693
Completion. create ~name: " dummy" ~env
1678
- ~kind: (Completion. Value (Utils. unwrapIfOption typ));
1694
+ ~kind: (Completion. Value (Utils. unwrapIfOption typ))
1695
+ () ;
1679
1696
])
1680
1697
| CArgument {functionContextPath; argumentLabel} -> (
1681
1698
let labels, env =
@@ -1710,7 +1727,8 @@ let rec getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos ~env
1710
1727
Completion. create ~name: " dummy" ~env
1711
1728
~kind:
1712
1729
(Completion. Value
1713
- (if expandOption then Utils. unwrapIfOption typ else typ));
1730
+ (if expandOption then Utils. unwrapIfOption typ else typ))
1731
+ () ;
1714
1732
])
1715
1733
1716
1734
let getOpens ~debug ~rawOpens ~package ~env =
@@ -1803,10 +1821,10 @@ let rec completeTypedValue (t : Types.type_expr) ~env ~full ~prefix
1803
1821
[
1804
1822
Completion. create ~name: " true"
1805
1823
~kind: (Label (t |> Shared. typeToString))
1806
- ~env ;
1824
+ ~env () ;
1807
1825
Completion. create ~name: " false"
1808
1826
~kind: (Label (t |> Shared. typeToString))
1809
- ~env ;
1827
+ ~env () ;
1810
1828
]
1811
1829
|> filterItems ~prefix
1812
1830
| Some (Tvariant {env; constructors; variantDecl; variantName} ) ->
@@ -1867,7 +1885,7 @@ let rec completeTypedValue (t : Types.type_expr) ~env ~full ~prefix
1867
1885
[
1868
1886
Completion. create ~name: " None"
1869
1887
~kind: (Label (t |> Shared. typeToString))
1870
- ~env ;
1888
+ ~env () ;
1871
1889
Completion. createWithSnippet ~name: " Some(_)"
1872
1890
~kind: (Label (t |> Shared. typeToString))
1873
1891
~env ~insert Text:" Some(${1:_})" () ;
@@ -1894,7 +1912,7 @@ let rec completeTypedValue (t : Types.type_expr) ~env ~full ~prefix
1894
1912
|> List. map (fun (field : field ) ->
1895
1913
Completion. create ~name: field.fname.txt
1896
1914
~kind: (Field (field, typeExpr |> Shared. typeToString))
1897
- ~env )
1915
+ ~env () )
1898
1916
|> filterItems ~prefix
1899
1917
| None ->
1900
1918
if prefix = " " then
@@ -1998,7 +2016,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover
1998
2016
| Cjsx ([id ], prefix , identsSeen ) when String. uncapitalize_ascii id = id ->
1999
2017
(* Lowercase JSX tag means builtin *)
2000
2018
let mkLabel (name , typString ) =
2001
- Completion. create ~name ~kind: (Label typString) ~env
2019
+ Completion. create ~name ~kind: (Label typString) ~env ()
2002
2020
in
2003
2021
let keyLabels =
2004
2022
if Utils. startsWith " key" prefix then [mkLabel (" key" , " string" )] else []
@@ -2012,7 +2030,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover
2012
2030
| Cjsx (componentPath , prefix , identsSeen ) ->
2013
2031
let labels = getJsxLabels ~component Path ~find TypeOfValue ~package in
2014
2032
let mkLabel_ name typString =
2015
- Completion. create ~name ~kind: (Label typString) ~env
2033
+ Completion. create ~name ~kind: (Label typString) ~env ()
2016
2034
in
2017
2035
let mkLabel (name , typ , _env ) =
2018
2036
mkLabel_ name (typ |> Shared. typeToString)
@@ -2031,7 +2049,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover
2031
2049
@ keyLabels
2032
2050
| Cdecorator prefix ->
2033
2051
let mkDecorator (name , docstring ) =
2034
- {(Completion. create ~name ~kind: (Label " " ) ~env ) with docstring}
2052
+ {(Completion. create ~name ~kind: (Label " " ) ~env () ) with docstring}
2035
2053
in
2036
2054
[
2037
2055
( " as" ,
@@ -2288,7 +2306,7 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
2288
2306
| None -> []
2289
2307
in
2290
2308
let mkLabel (name , typ ) =
2291
- Completion. create ~name ~kind: (Label (typ |> Shared. typeToString)) ~env
2309
+ Completion. create ~name ~kind: (Label (typ |> Shared. typeToString)) ~env ()
2292
2310
in
2293
2311
labels
2294
2312
|> List. filter (fun (name , _t ) ->
0 commit comments