Skip to content

Commit d29c4a2

Browse files
bors[bot]matklad
andauthored
Merge #3400
3400: Don't fail loudly if the old highlighting breaks r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 02f761b + dbd1698 commit d29c4a2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

editors/code/src/highlighting.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ function initDecorations(): Map<string, vscode.TextEditorDecorationType> {
159159
const theme = ColorTheme.load();
160160
const res = new Map();
161161
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;
163165
const rule = theme.lookup(scopes);
164166
const decor = createDecorationFromTextmate(rule);
165167
res.set(tag, decor);
@@ -211,7 +213,7 @@ const TAG_TO_SCOPES = new Map<string, string[]>([
211213
["macro", ["entity.name.macro"]],
212214

213215
["variable", ["variable"]],
214-
["variable.mut", ["variable", "meta.mutable"]],
216+
["variable.mutable", ["variable", "meta.mutable"]],
215217

216218
["type", ["entity.name.type"]],
217219
["type.builtin", ["entity.name.type", "support.type.primitive"]],
@@ -221,10 +223,10 @@ const TAG_TO_SCOPES = new Map<string, string[]>([
221223

222224
["literal.byte", ["constant.character.byte"]],
223225
["literal.char", ["constant.character.rust"]],
224-
["literal.numeric", ["constant.numeric"]],
226+
["numeric_literal", ["constant.numeric"]],
225227

226228
["comment", ["comment"]],
227-
["string", ["string.quoted"]],
229+
["string_literal", ["string.quoted"]],
228230
["attribute", ["meta.attribute.rust"]],
229231

230232
["keyword", ["keyword"]],

0 commit comments

Comments
 (0)