Skip to content

Commit 9f4c3b2

Browse files
committed
Syntax highlighting: support more themes.
Instead of semantic token `type` use `support.type` from the grammar. This is what TypeScript does too. For keywords from the grammar, use `storage.type` instead of `keyword`. Again this is taken from what TS does. This change is a no-op on the themes considered so far. But improves theme `Solarized Light`. There seems to be no way to fix `Mariana Pro (Warm)`, which completely disables semantic highlighting. Looks like TS has the same problem there.
1 parent 3a26aa8 commit 9f4c3b2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

grammars/rescript.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"match": "\\b(false|true)\\b"
3939
},
4040
"RE_KEYWORD": {
41-
"name": "keyword",
41+
"name": "storage.type",
4242
"match": "\\b(include|let|module|of|open|type)\\b"
4343
},
4444
"commentLine": {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
{
3333
"scopes": {
3434
"jsx-lowercase": ["entity.name.tag"],
35-
"jsx-tag": ["punctuation.definition.tag"]
35+
"jsx-tag": ["punctuation.definition.tag"],
36+
"support-type": ["support.type"]
3637
}
3738
}
3839
],

server/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ function onMessage(msg: m.Message) {
815815
tokenTypes: [
816816
"operator",
817817
"variable",
818-
"type",
818+
"support-type",
819819
"jsx-tag",
820820
"class",
821821
"enumMember",

0 commit comments

Comments
 (0)