aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/highlighting.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index 036183834..ea2dfc0e3 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -159,7 +159,9 @@ function initDecorations(): Map<string, vscode.TextEditorDecorationType> {
159 const theme = ColorTheme.load(); 159 const theme = ColorTheme.load();
160 const res = new Map(); 160 const res = new Map();
161 TAG_TO_SCOPES.forEach((scopes, tag) => { 161 TAG_TO_SCOPES.forEach((scopes, tag) => {
162 if (!scopes) throw `unmapped tag: ${tag}`; 162 // We are going to axe this soon, so don't try to detect unknown tags.
163 // Users should switch to the new semantic tokens implementation.
164 if (!scopes) return;
163 const rule = theme.lookup(scopes); 165 const rule = theme.lookup(scopes);
164 const decor = createDecorationFromTextmate(rule); 166 const decor = createDecorationFromTextmate(rule);
165 res.set(tag, decor); 167 res.set(tag, decor);
@@ -211,7 +213,7 @@ const TAG_TO_SCOPES = new Map<string, string[]>([
211 ["macro", ["entity.name.macro"]], 213 ["macro", ["entity.name.macro"]],
212 214
213 ["variable", ["variable"]], 215 ["variable", ["variable"]],
214 ["variable.mut", ["variable", "meta.mutable"]], 216 ["variable.mutable", ["variable", "meta.mutable"]],
215 217
216 ["type", ["entity.name.type"]], 218 ["type", ["entity.name.type"]],
217 ["type.builtin", ["entity.name.type", "support.type.primitive"]], 219 ["type.builtin", ["entity.name.type", "support.type.primitive"]],
@@ -221,10 +223,10 @@ const TAG_TO_SCOPES = new Map<string, string[]>([
221 223
222 ["literal.byte", ["constant.character.byte"]], 224 ["literal.byte", ["constant.character.byte"]],
223 ["literal.char", ["constant.character.rust"]], 225 ["literal.char", ["constant.character.rust"]],
224 ["literal.numeric", ["constant.numeric"]], 226 ["numeric_literal", ["constant.numeric"]],
225 227
226 ["comment", ["comment"]], 228 ["comment", ["comment"]],
227 ["string", ["string.quoted"]], 229 ["string_literal", ["string.quoted"]],
228 ["attribute", ["meta.attribute.rust"]], 230 ["attribute", ["meta.attribute.rust"]],
229 231
230 ["keyword", ["keyword"]], 232 ["keyword", ["keyword"]],