Skip to content

Commit 5990a91

Browse files
committed
Fix JSX autocomplete tests.
1 parent 7a974ec commit 5990a91

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

analysis/src/PartialParser.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ let findCallFromArgument text offset =
5252
loop ~i:offset ~nClosed:0
5353

5454
(* skip A or #A if present *)
55-
let skipOptVariant text i =
56-
prerr_endline "skipOptIdent";
55+
let rec skipOptVariant text i =
5756
if i > 0 then
5857
match text.[i] with
5958
| 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' ->
6059
let i = startOfLident text i - 1 in
6160
let i =
62-
if i > 0 then match text.[i] with '#' -> i - 1 | _ -> i else i
61+
if i > 0 then match text.[i] with '#' | '%' -> i - 1 | _ -> i else i
6362
in
6463
i
64+
| '%' -> skipOptVariant text (i - 1)
6565
| _ -> i
6666
else i
6767

analysis/tests/src/Jsx.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ let y = 44
3737

3838
//^com <M prop=`before${foo}` k
3939

40-
//<M prop=module(@foo Three: X_int) k
40+
//^com <M prop=module(@foo Three: X_int) k
4141

42-
//<M prop=%bs.raw("1") k
42+
//^com <M prop=%bs.raw("1") k

analysis/tests/src/expected/Jsx.res.txt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Complete tests/src/Jsx.res 11:2
7171
}]
7272

7373
Complete tests/src/Jsx.res 18:2
74-
skipOptIdent
7574
[{
7675
"label": "key",
7776
"kind": 4,
@@ -81,7 +80,6 @@ skipOptIdent
8180
}]
8281

8382
Complete tests/src/Jsx.res 20:2
84-
skipOptIdent
8583
[{
8684
"label": "key",
8785
"kind": 4,
@@ -91,7 +89,6 @@ skipOptIdent
9189
}]
9290

9391
Complete tests/src/Jsx.res 22:2
94-
skipOptIdent
9592
[{
9693
"label": "key",
9794
"kind": 4,
@@ -101,7 +98,6 @@ skipOptIdent
10198
}]
10299

103100
Complete tests/src/Jsx.res 24:2
104-
skipOptIdent
105101
[{
106102
"label": "key",
107103
"kind": 4,
@@ -164,3 +160,21 @@ Complete tests/src/Jsx.res 36:2
164160
"documentation": null
165161
}]
166162

163+
Complete tests/src/Jsx.res 38:2
164+
[{
165+
"label": "key",
166+
"kind": 4,
167+
"tags": [],
168+
"detail": "string",
169+
"documentation": null
170+
}]
171+
172+
Complete tests/src/Jsx.res 40:2
173+
[{
174+
"label": "key",
175+
"kind": 4,
176+
"tags": [],
177+
"detail": "string",
178+
"documentation": null
179+
}]
180+

0 commit comments

Comments
 (0)