Skip to content

Commit

Permalink
Highlight poly variant
Browse files Browse the repository at this point in the history
  • Loading branch information
chenglou committed Dec 5, 2020
1 parent 25203d9 commit ce20f7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ReScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ contexts:
# variant and modules confused
# scope: entity.name.union
scope: variable.function variable.other
- match: '(#)(\.\.\.)?[a-zA-Z][0-9a-zA-Z_]*\b'
- match: '(#)(\.\.\.)?([a-zA-Z][0-9a-zA-Z_]*)\b'
captures:
1: punctuation.definition.keyword
2: punctuation.definition.keyword
# see comment above
3: variable.function variable.other

array:
- match: '\['
Expand Down
2 changes: 2 additions & 0 deletions syntax_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ let interp = j`hello ${world.bla->b(a)} bye`
// ^ string.quoted.other punctuation.definition.string.end
let variant = #foo
// ^ source.res punctuation.definition.keyword
// ^^^ variable.function variable.other
let #...foo = bar
// ^^^^ punctuation.definition.keyword
// ^^^ variable.function variable.other

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

0 comments on commit ce20f7c

Please sign in to comment.