This repository was archived by the owner on Apr 24, 2021. It is now read-only.
File tree 3 files changed +7
-1
lines changed
examples/example-project/src
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -138,3 +138,5 @@ let lll = List.make(3, 4)
138
138
139
139
let abc = "abc"
140
140
141
+ let arr = [1 , 2 , 3 ]
142
+
Original file line number Diff line number Diff line change @@ -513,6 +513,7 @@ let processCompletable ~findItems ~full ~package ~pos ~rawOpens
513
513
mkItem ~name ~kind: (kindToInt item) ~deprecated
514
514
~detail: (detail name item) ~docstring ~uri ~pos_lnum )
515
515
| Cpipe (pipe , partialName ) -> (
516
+ let arrayModulePath = [" Js" ; " Array2" ] in
516
517
let stringModulePath = [" Js" ; " String2" ] in
517
518
let getModulePath path =
518
519
let rec loop (path : Path.t ) =
@@ -523,6 +524,7 @@ let processCompletable ~findItems ~full ~package ~pos ~rawOpens
523
524
in
524
525
match path with
525
526
| Path. Pident id when Ident. name id = " string" -> stringModulePath
527
+ | Path. Pident id when Ident. name id = " array" -> arrayModulePath
526
528
| _ -> ( match loop path with _ :: rest -> List. rev rest | [] -> [] )
527
529
in
528
530
let getLhsPath ~pipeId ~partialName =
@@ -541,6 +543,7 @@ let processCompletable ~findItems ~full ~package ~pos ~rawOpens
541
543
match pipe with
542
544
| PipeId pipeId -> getLhsPath ~pipe Id ~partial Name
543
545
| PipeString -> Some (stringModulePath, partialName)
546
+ | PipeArray -> Some (arrayModulePath, partialName)
544
547
in
545
548
let removePackageOpens modulePath =
546
549
match modulePath with
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ let findJsxContext text offset =
109
109
in
110
110
loop offset
111
111
112
- type pipe = PipeId of string | PipeString
112
+ type pipe = PipeId of string | PipeArray | PipeString
113
113
114
114
type completable =
115
115
| Cdecorator of string (* * e.g. @module *)
@@ -155,6 +155,7 @@ let findCompletable text offset =
155
155
match text.[i] with
156
156
| 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '.' | '_' -> loop (i - 1 )
157
157
| '"' when i == off -> Some PipeString
158
+ | ']' when i == off -> Some PipeArray
158
159
| _ -> Some (PipeId (String. sub text (i + 1 ) (off - i))))
159
160
in
160
161
match loop off with
You can’t perform that action at this time.
0 commit comments