Skip to content

Commit 6a86641

Browse files
committed
skipOptVariantExtension
1 parent 5990a91 commit 6a86641

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

analysis/src/PartialParser.ml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ let findCallFromArgument text offset =
5151
in
5252
loop ~i:offset ~nClosed:0
5353

54-
(* skip A or #A if present *)
55-
let rec skipOptVariant text i =
54+
(* skip A or #A or %A if present *)
55+
let skipOptVariantExtension text i =
5656
if i > 0 then
5757
match text.[i] with
5858
| 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' ->
@@ -61,8 +61,7 @@ let rec skipOptVariant text i =
6161
if i > 0 then match text.[i] with '#' | '%' -> i - 1 | _ -> i else i
6262
in
6363
i
64-
| '%' -> skipOptVariant text (i - 1)
65-
| _ -> i
64+
| _ -> i
6665
else i
6766

6867
(* Figure out whether id should be autocompleted as component prop.
@@ -118,7 +117,7 @@ let findJsxContext text offset =
118117
else None
119118
and beforeParen identsSeen i =
120119
let i = skipWhite text i in
121-
beforeValue identsSeen (skipOptVariant text i)
120+
beforeValue identsSeen (skipOptVariantExtension text i)
122121
and beforeValue identsSeen i =
123122
let i = skipWhite text i in
124123
if i > 0 then

0 commit comments

Comments
 (0)