File tree Expand file tree Collapse file tree 4 files changed +28
-2
lines changed Expand file tree Collapse file tree 4 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 44- Fix issue where values for autocomplete were pulled from implementations instead of interfaces.
55- Add autocompletion for object access of the form foo[ "bar"] .
66- Fix issue with autocomplete then punned props are used in JSX. E.g. ` <M foo ...> ` .
7+ - Fix issue with JSX autocompletion not working after ` foo=#variant ` .
78
89## 1.1.3
910
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ let skipOptVariantExtension text i =
107107 Find JSX context ctx for component M to autocomplete id (already parsed) as a prop.
108108 ctx ::= <M args id
109109 arg ::= id | id = [?] atomicExpr
110- atomicExpr ::= id | "abc" | 'a' | 42 | `...` | optVariant {...} | optVariant (...) | <...> | [...]
110+ atomicExpr ::= id | #id | "abc" | 'a' | 42 | `...` | optVariant {...} | optVariant (...) | <...> | [...]
111111 optVariant ::= id | #id | %id | _nothing_
112112*)
113113let findJsxContext text offset =
@@ -143,7 +143,10 @@ let findJsxContext text offset =
143143 match ident.[0 ] with
144144 | ('a' .. 'z' | 'A' .. 'Z' ) when i1 > = 1 && text.[i1 - 1 ] = '<' ->
145145 Some (ident, identsSeen)
146- | _ -> beforeIdent ~ident identsSeen (i1 - 1 )
146+ | _ ->
147+ if i1 > = 1 && text.[i1 - 1 ] = '#' then
148+ beforeValue identsSeen (i1 - 2 )
149+ else beforeIdent ~ident identsSeen (i1 - 1 )
147150 else None
148151 else None
149152 and beforeIdent ~ident identsSeen i =
Original file line number Diff line number Diff line change @@ -54,3 +54,7 @@ let _ = (Ext.make, Ext.makeProps)
5454//^com <Ext al
5555
5656//^com <M first
57+
58+ //^com <M first=#a k
59+
60+ //^com <M first = ? #a k
Original file line number Diff line number Diff line change @@ -211,3 +211,21 @@ Complete tests/src/Jsx.res 54:2
211211 "documentation": null
212212 }]
213213
214+ Complete tests/src/Jsx.res 56:2
215+ [{
216+ "label": "key",
217+ "kind": 4,
218+ "tags": [],
219+ "detail": "string",
220+ "documentation": null
221+ }]
222+
223+ Complete tests/src/Jsx.res 58:2
224+ [{
225+ "label": "key",
226+ "kind": 4,
227+ "tags": [],
228+ "detail": "string",
229+ "documentation": null
230+ }]
231+
You can’t perform that action at this time.
0 commit comments