From fe435ffb2728be87df1bba4d0ef5ae8b9626c120 Mon Sep 17 00:00:00 2001 From: George Fraser Date: Sat, 7 Nov 2020 10:50:57 -0800 Subject: [PATCH 1/2] Use builtin scopes more --- crates/rust-analyzer/src/semantic_tokens.rs | 4 ++-- editors/code/package.json | 9 --------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/rust-analyzer/src/semantic_tokens.rs b/crates/rust-analyzer/src/semantic_tokens.rs index e7991fd281c..783b3df1e57 100644 --- a/crates/rust-analyzer/src/semantic_tokens.rs +++ b/crates/rust-analyzer/src/semantic_tokens.rs @@ -40,7 +40,7 @@ macro_rules! define_semantic_token_types { define_semantic_token_types![ (ATTRIBUTE, "attribute"), (BOOLEAN, "boolean"), - (BUILTIN_TYPE, "builtinType"), + (BUILTIN_TYPE, "type.defaultLibrary"), (ESCAPE_SEQUENCE, "escapeSequence"), (FORMAT_SPECIFIER, "formatSpecifier"), (GENERIC, "generic"), @@ -70,7 +70,7 @@ macro_rules! define_semantic_token_modifiers { } define_semantic_token_modifiers![ - (CONSTANT, "constant"), + (CONSTANT, "readonly"), (CONTROL_FLOW, "controlFlow"), (INJECTED, "injected"), (MUTABLE, "mutable"), diff --git a/editors/code/package.json b/editors/code/package.json index eccafccdd9e..02d35212442 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -939,9 +939,6 @@ { "language": "rust", "scopes": { - "macro": [ - "entity.name.function.macro.rust" - ], "attribute": [ "meta.attribute.rust" ], @@ -951,9 +948,6 @@ "boolean": [ "constant.language.boolean.rust" ], - "builtinType": [ - "support.type.primitive.rust" - ], "lifetime": [ "storage.modifier.lifetime.rust" ], @@ -972,9 +966,6 @@ "keyword.controlFlow": [ "keyword.control.rust" ], - "variable.constant": [ - "variable.other.constant.rust" - ], "formatSpecifier": [ "punctuation.section.embedded.rust" ], From ac314f88c62fed14afd608520ecfea6bdb0a3f31 Mon Sep 17 00:00:00 2001 From: George Fraser Date: Wed, 25 Nov 2020 08:39:39 -0800 Subject: [PATCH 2/2] Just remove the macro fallback --- crates/rust-analyzer/src/semantic_tokens.rs | 4 ++-- editors/code/package.json | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/rust-analyzer/src/semantic_tokens.rs b/crates/rust-analyzer/src/semantic_tokens.rs index 783b3df1e57..e7991fd281c 100644 --- a/crates/rust-analyzer/src/semantic_tokens.rs +++ b/crates/rust-analyzer/src/semantic_tokens.rs @@ -40,7 +40,7 @@ macro_rules! define_semantic_token_types { define_semantic_token_types![ (ATTRIBUTE, "attribute"), (BOOLEAN, "boolean"), - (BUILTIN_TYPE, "type.defaultLibrary"), + (BUILTIN_TYPE, "builtinType"), (ESCAPE_SEQUENCE, "escapeSequence"), (FORMAT_SPECIFIER, "formatSpecifier"), (GENERIC, "generic"), @@ -70,7 +70,7 @@ macro_rules! define_semantic_token_modifiers { } define_semantic_token_modifiers![ - (CONSTANT, "readonly"), + (CONSTANT, "constant"), (CONTROL_FLOW, "controlFlow"), (INJECTED, "injected"), (MUTABLE, "mutable"), diff --git a/editors/code/package.json b/editors/code/package.json index 02d35212442..fa8cf90f827 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -948,6 +948,9 @@ "boolean": [ "constant.language.boolean.rust" ], + "builtinType": [ + "support.type.primitive.rust" + ], "lifetime": [ "storage.modifier.lifetime.rust" ], @@ -966,6 +969,9 @@ "keyword.controlFlow": [ "keyword.control.rust" ], + "variable.constant": [ + "variable.other.constant.rust" + ], "formatSpecifier": [ "punctuation.section.embedded.rust" ],