File tree 4 files changed +28
-2
lines changed
4 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 4
4
- Fix issue where values for autocomplete were pulled from implementations instead of interfaces.
5
5
- Add autocompletion for object access of the form foo[ "bar"] .
6
6
- 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 ` .
7
8
8
9
## 1.1.3
9
10
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ let skipOptVariantExtension text i =
107
107
Find JSX context ctx for component M to autocomplete id (already parsed) as a prop.
108
108
ctx ::= <M args id
109
109
arg ::= id | id = [?] atomicExpr
110
- atomicExpr ::= id | "abc" | 'a' | 42 | `...` | optVariant {...} | optVariant (...) | <...> | [...]
110
+ atomicExpr ::= id | #id | "abc" | 'a' | 42 | `...` | optVariant {...} | optVariant (...) | <...> | [...]
111
111
optVariant ::= id | #id | %id | _nothing_
112
112
*)
113
113
let findJsxContext text offset =
@@ -143,7 +143,10 @@ let findJsxContext text offset =
143
143
match ident.[0 ] with
144
144
| ('a' .. 'z' | 'A' .. 'Z' ) when i1 > = 1 && text.[i1 - 1 ] = '<' ->
145
145
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 )
147
150
else None
148
151
else None
149
152
and beforeIdent ~ident identsSeen i =
Original file line number Diff line number Diff line change @@ -54,3 +54,7 @@ let _ = (Ext.make, Ext.makeProps)
54
54
//^com <Ext al
55
55
56
56
//^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
211
211
"documentation": null
212
212
}]
213
213
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