@@ -1521,6 +1521,8 @@ let rec extractType ~env ~package (t : Types.type_expr) =
1521
1521
| Tlink t1 | Tsubst t1 | Tpoly (t1 , [] ) -> extractType ~env ~package t1
1522
1522
| Tconstr (Path. Pident {name = "option" } , [payloadTypeExpr ], _ ) ->
1523
1523
Some (Completable. Toption (env, payloadTypeExpr))
1524
+ | Tconstr (Path. Pident {name = "array" } , [payloadTypeExpr ], _ ) ->
1525
+ Some (Tarray (env, payloadTypeExpr))
1524
1526
| Tconstr (Path. Pident {name = "bool" } , [] , _ ) -> Some (Tbool env)
1525
1527
| Tconstr (path , _ , _ ) -> (
1526
1528
match References. digConstructor ~env ~package path with
@@ -1665,6 +1667,12 @@ let completeTypedValue ~env ~envWhereCompletionStarted ~full ~prefix
1665
1667
~insert Text:(if ! Cfg. supportsSnippets then " {$0}" else " {}" )
1666
1668
~sort Text:" a" ~kind: (Value typeExpr) ~env () ;
1667
1669
])
1670
+ | Some (Tarray (env , typeExpr )) ->
1671
+ [
1672
+ Completion. createWithSnippet ~name: " []"
1673
+ ~insert Text:(if ! Cfg. supportsSnippets then " [$0]" else " []" )
1674
+ ~sort Text:" a" ~kind: (Value typeExpr) ~env () ;
1675
+ ]
1668
1676
| _ -> []
1669
1677
in
1670
1678
(* Include all values and modules in completion if there's a prefix, not otherwise *)
@@ -1796,6 +1804,8 @@ let rec resolveNestedPattern typ ~env ~package ~nested =
1796
1804
match List. nth_opt constructor.args payloadNum with
1797
1805
| None -> None
1798
1806
| Some typ -> typ |> resolveNestedPattern ~env ~package ~nested ))
1807
+ | PArray , Some (Tarray (env , typ )) ->
1808
+ typ |> resolveNestedPattern ~env ~package ~nested
1799
1809
| _ -> None )
1800
1810
1801
1811
let processCompletable ~debug ~full ~scope ~env ~pos ~forHover
0 commit comments