From 1a9b8095b641ec2e10609dc9f40882ce13562e00 Mon Sep 17 00:00:00 2001 From: thsm Date: Tue, 21 Dec 2021 15:38:18 -0800 Subject: [PATCH] added {| |}, etc to vscode syntax highlighter --- .../vscode/language-configuration.json | 4 +++- .../vscode/syntaxes/c3.tmLanguage.json | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/resources/editor_plugins/vscode/language-configuration.json b/resources/editor_plugins/vscode/language-configuration.json index 8f162a0c4..de79e9798 100644 --- a/resources/editor_plugins/vscode/language-configuration.json +++ b/resources/editor_plugins/vscode/language-configuration.json @@ -9,13 +9,15 @@ "brackets": [ ["{", "}"], ["[", "]"], - ["(", ")"] + ["(", ")"], + ["{|", "|}"] ], // symbols that are auto closed when typing "autoClosingPairs": [ ["{", "}"], ["[", "]"], ["(", ")"], + ["{|", "|}"], ["\"", "\""], ["'", "'"] ], diff --git a/resources/editor_plugins/vscode/syntaxes/c3.tmLanguage.json b/resources/editor_plugins/vscode/syntaxes/c3.tmLanguage.json index ed74ba568..246aaaed1 100644 --- a/resources/editor_plugins/vscode/syntaxes/c3.tmLanguage.json +++ b/resources/editor_plugins/vscode/syntaxes/c3.tmLanguage.json @@ -19,7 +19,7 @@ }, { "name": "keyword", - "match": "\\b(do|else|for|goto|if|return|null)\\b" + "match": "\\b(do|else|for|goto|if|return|null|macro)\\b" }, { "name": "keyword", @@ -27,7 +27,7 @@ }, { "name": "keyword", - "match": "\\b(generic|switch|typedef|volatile)\\b" + "match": "\\b(generic|switch|typedef|volatile|private)\\b" }, { "name": "keyword", @@ -138,12 +138,20 @@ "match": "\\b(double|usize|type|Type|bool|char|enum|float|int|uint|long|ulong|short|ushort|struct|void)\\b" }, "support": { - "name": "support.function.builtin", - "match": "\\$[_a-zA-Z][_a-zA-Z0-9]*" + "patterns": [ + { + "name": "support.function.builtin", + "match": "\\$[_a-zA-Z][_a-zA-Z0-9]*" + }, + { + "name": "support.function.macro", + "match": "@[_a-zA-Z][_a-zA-Z0-9]*" + } + ] }, "operators": { "name": "keyword.operator", - "match": "(\\+|-|\\.|%|&|\\||=|<|>|!|\\^|\\*|/|::)=?" + "match": "(\\+|-|\\.|%|&|\\|(?!})|=|<|>|!|\\^|\\*|/|::)=?" } }, "scopeName": "source.c3"