about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-03-02 14:45:20 +0100
committerAleksey Kladov <aleksey.kladov@gmail.com>2020-03-02 14:46:46 +0100
commitdbd1698e02da46af308740aba193872e1f760490 (patch)
tree5aa78827742bde6b7585acb23da640d292e5b2f3 /editors/code/src
parent02f761ba4bd356ef2aeae5ed8bdd750c57ade30d (diff)
downloadrust-dbd1698e02da46af308740aba193872e1f760490.tar.gz
rust-dbd1698e02da46af308740aba193872e1f760490.zip
Don't fail loudly if the old highlighting breaks
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 3e0cbdc5616..d7d0e910b79 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -159,7 +159,9 @@ function initDecorations(): Map<string, vscode.TextEditorDecorationType> {
     const theme = ColorTheme.load();
     const res = new Map();
     TAG_TO_SCOPES.forEach((scopes, tag) => {
-        if (!scopes) throw `unmapped tag: ${tag}`;
+        // We are going to axe this soon, so don't try to detect unknown tags.
+        // Users should switch to the new semantic tokens implementation.
+        if (!scopes) return;
         const rule = theme.lookup(scopes);
         const decor = createDecorationFromTextmate(rule);
         res.set(tag, decor);
@@ -211,7 +213,7 @@ const TAG_TO_SCOPES = new Map<string, string[]>([
     ["macro", ["entity.name.macro"]],
 
     ["variable", ["variable"]],
-    ["variable.mut", ["variable", "meta.mutable"]],
+    ["variable.mutable", ["variable", "meta.mutable"]],
 
     ["type", ["entity.name.type"]],
     ["type.builtin", ["entity.name.type", "support.type.primitive"]],
@@ -221,10 +223,10 @@ const TAG_TO_SCOPES = new Map<string, string[]>([
 
     ["literal.byte", ["constant.character.byte"]],
     ["literal.char", ["constant.character.rust"]],
-    ["literal.numeric", ["constant.numeric"]],
+    ["numeric_literal", ["constant.numeric"]],
 
     ["comment", ["comment"]],
-    ["string", ["string.quoted"]],
+    ["string_literal", ["string.quoted"]],
     ["attribute", ["meta.attribute.rust"]],
 
     ["keyword", ["keyword"]],