diff --git a/grammars/rescript.tmLanguage.json b/grammars/rescript.tmLanguage.json index 014bd7259..1fa324d95 100644 --- a/grammars/rescript.tmLanguage.json +++ b/grammars/rescript.tmLanguage.json @@ -51,31 +51,27 @@ }, { "match": "\\,", - "name": "punctuation.separator" + "name": "constant.character punctuation.separator" }, { "match": "\\?|:", - "name": "punctuation.separator" - }, - { - "match": "\\|(?!\\|)", - "name": "punctuation.separator" + "name": "constant.character punctuation.separator" }, { "match": "\\{", - "name": "punctuation.section.braces.begin" + "name": "constant.character punctuation.section.braces.begin" }, { "match": "\\}", - "name": "punctuation.section.braces.end" + "name": "constant.character punctuation.section.braces.end" }, { "match": "\\(", - "name": "punctuation.section.parens.begin" + "name": "constant.character punctuation.section.parens.begin" }, { "match": "\\)", - "name": "punctuation.section.parens.end" + "name": "constant.character punctuation.section.parens.end" } ] }, @@ -224,7 +220,7 @@ "name": "punctuation.definition.keyword" }, "3": { - "name": "variable.function variable.other" + "name": "variable.function variable.other variable.other.enummember constant.other.symbol" } } } @@ -234,11 +230,11 @@ "patterns": [ { "match": "\\[", - "name": "punctuation.section.brackets.begin" + "name": "constant.character punctuation.section.brackets.begin" }, { "match": "\\]", - "name": "punctuation.section.brackets.end" + "name": "constant.character punctuation.section.brackets.end" } ] }, @@ -251,13 +247,13 @@ "name": "keyword" }, "2": { - "name": "punctuation.section.braces.begin" + "name": "constant.character punctuation.section.braces.begin" } } }, { "match": "\\}", - "name": "punctuation.section.braces.end" + "name": "constant.character punctuation.section.braces.end" } ] }, @@ -267,13 +263,13 @@ "match": "\\b[a-z_][0-9a-zA-Z_]*(\\[)", "captures": { "1": { - "name": "punctuation.section.brackets.begin" + "name": "constant.character punctuation.section.brackets.begin" } } }, { "match": "\\]", - "name": "punctuation.section.brackets.end" + "name": "constant.character punctuation.section.brackets.end" } ] }, @@ -430,6 +426,46 @@ ] } ] + }, + "variableDeclaration": { + "patterns": [ + { + "match": "(?<=external )[a-z_][0-9a-zA-Z_]*", + "name": "entity.name.function" + }, + { + "match": "(?<=let )[a-z_][0-9a-zA-Z_]*", + "name": "entity.name.function" + }, + { + "match": "(?<=let rec )[a-z_][0-9a-zA-Z_]*", + "name": "entity.name.function" + } + ] + }, + "typeDeclaration": { + "patterns": [ + { + "match": "(?<=type )[a-z_][0-9a-zA-Z_]*", + "name": "entity.name.function" + }, + { + "match": "(?<=and )[a-z_][0-9a-zA-Z_]*", + "name": "entity.name.function" + }, + { + "match": "(?<=type rec )[a-z_][0-9a-zA-Z_]*", + "name": "entity.name.function" + } + ] + }, + "recordProperty": { + "patterns": [ + { + "name": "variable.object.property", + "match": "([a-z_][0-9a-zA-Z_]*(?=:))" + } + ] } }, "patterns": [ @@ -492,6 +528,15 @@ }, { "include": "#punctuations" + }, + { + "include": "#typeDeclaration" + }, + { + "include": "#variableDeclaration" + }, + { + "include": "#recordProperty" } ] }