File tree Expand file tree Collapse file tree 3 files changed +67
-2
lines changed Expand file tree Collapse file tree 3 files changed +67
-2
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ let skipOptVariant text i =
68
68
(* Figure out whether id should be autocompleted as component prop.
69
69
Find JSX context ctx for component M to autocomplete id (already parsed) as a prop.
70
70
ctx ::= <M args id
71
- arg ::= id | id = [?] val
72
- val ::= id | "abc" | 42 | optVariant {...} | optVariant (...) | <...> | [...]
71
+ arg ::= id | id = [?] atomicExpr
72
+ atomicExpr ::= id | "abc" | 'a' | 42 | `...` | optVariant {...} | optVariant (...) | <...> | [...]
73
73
optVariant ::= a | A | #a | #A | _nothing_
74
74
*)
75
75
let findJsxContext text offset =
@@ -92,6 +92,12 @@ let findJsxContext text offset =
92
92
| '"' ->
93
93
let i1 = findBack text '"' (i - 1 ) in
94
94
if i1 > 0 then beforeValue identsSeen i1 else None
95
+ | '\' ' ->
96
+ let i1 = findBack text '\' ' (i - 1 ) in
97
+ if i1 > 0 then beforeValue identsSeen i1 else None
98
+ | '`' ->
99
+ let i1 = findBack text '`' (i - 1 ) in
100
+ if i1 > 0 then beforeValue identsSeen i1 else None
95
101
| _ ->
96
102
let i1 = startOfLident text i in
97
103
let ident = String. sub text i1 (i - i1 + 1 ) in
Original file line number Diff line number Diff line change @@ -26,3 +26,17 @@ let y = 44
26
26
//^com <M prop=list{1,2,3} k
27
27
28
28
//^com <M prop=<N /> k
29
+
30
+ //^com <M prop=1.5 k
31
+
32
+ //^com <M prop=0X33 k
33
+
34
+ //^com <M prop=12e+3 k
35
+
36
+ //^com <M prop='z' k
37
+
38
+ //^com <M prop=`before${foo}` k
39
+
40
+ //<M prop=module(@foo Three: X_int) k
41
+
42
+ //<M prop=%bs.raw("1") k
Original file line number Diff line number Diff line change @@ -119,3 +119,48 @@ Complete tests/src/Jsx.res 26:2
119
119
"documentation": null
120
120
}]
121
121
122
+ Complete tests/src/Jsx.res 28:2
123
+ [{
124
+ "label": "key",
125
+ "kind": 4,
126
+ "tags": [],
127
+ "detail": "string",
128
+ "documentation": null
129
+ }]
130
+
131
+ Complete tests/src/Jsx.res 30:2
132
+ [{
133
+ "label": "key",
134
+ "kind": 4,
135
+ "tags": [],
136
+ "detail": "string",
137
+ "documentation": null
138
+ }]
139
+
140
+ Complete tests/src/Jsx.res 32:2
141
+ [{
142
+ "label": "key",
143
+ "kind": 4,
144
+ "tags": [],
145
+ "detail": "string",
146
+ "documentation": null
147
+ }]
148
+
149
+ Complete tests/src/Jsx.res 34:2
150
+ [{
151
+ "label": "key",
152
+ "kind": 4,
153
+ "tags": [],
154
+ "detail": "string",
155
+ "documentation": null
156
+ }]
157
+
158
+ Complete tests/src/Jsx.res 36:2
159
+ [{
160
+ "label": "key",
161
+ "kind": 4,
162
+ "tags": [],
163
+ "detail": "string",
164
+ "documentation": null
165
+ }]
166
+
You can’t perform that action at this time.
0 commit comments