Skip to content

Commit ebc26cd

Browse files
committed
Highlight type param
This is one of the few remaining unambiguous things in our syntax (uuugh), so let's at least highlight this first.
1 parent 5262fa9 commit ebc26cd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ReScript.sublime-syntax

+5
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ contexts:
121121
- match: '''[\x00-\x7F]'''
122122
scope: string.quoted.single
123123

124+
typeParameter:
125+
- match: '''[A-Za-z][A-Za-z0-9_]*'
126+
scope: support.type
127+
124128
number:
125129
- match:
126130
\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\.[0-9_]+)?([eE][-+]?[0-9_]+)?)?)\b
@@ -285,6 +289,7 @@ contexts:
285289
- include: commentLine
286290
- include: commentBlock
287291
- include: character
292+
- include: typeParameter
288293
- include: string
289294
- include: attribute
290295
- include: function

syntax_test.res

+2
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,13 @@ let asd = foo["bar"]
132132

133133
type bla<'a> = {
134134
// <- storage.type
135+
// ^^ support.type
135136
// ^ punctuation.section.braces.begin
136137
a: int,
137138
// ^ punctuation.separator
138139
// ^ punctuation.separator
139140
ok: 'a,
141+
// ^^ support.type
140142
}
141143
// <- punctuation.section.braces.end
142144

0 commit comments

Comments
 (0)