Skip to content

Commit ce20f7c

Browse files
committed
Highlight poly variant
1 parent 25203d9 commit ce20f7c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ReScript.sublime-syntax

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,12 @@ contexts:
142142
# variant and modules confused
143143
# scope: entity.name.union
144144
scope: variable.function variable.other
145-
- match: '(#)(\.\.\.)?[a-zA-Z][0-9a-zA-Z_]*\b'
145+
- match: '(#)(\.\.\.)?([a-zA-Z][0-9a-zA-Z_]*)\b'
146146
captures:
147147
1: punctuation.definition.keyword
148148
2: punctuation.definition.keyword
149+
# see comment above
150+
3: variable.function variable.other
149151

150152
array:
151153
- match: '\['

syntax_test.res

+2
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,10 @@ let interp = j`hello ${world.bla->b(a)} bye`
314314
// ^ string.quoted.other punctuation.definition.string.end
315315
let variant = #foo
316316
// ^ source.res punctuation.definition.keyword
317+
// ^^^ variable.function variable.other
317318
let #...foo = bar
318319
// ^^^^ punctuation.definition.keyword
320+
// ^^^ variable.function variable.other
319321

320322
@foo(bar) let a = 1
321323
// ^ source.res meta.annotation punctuation.definition.annotation

0 commit comments

Comments
 (0)