aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/conv.rs4
-rw-r--r--crates/rust-analyzer/src/semantic_tokens.rs2
2 files changed, 4 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/conv.rs b/crates/rust-analyzer/src/conv.rs
index 86851c1f1..b012f5dd5 100644
--- a/crates/rust-analyzer/src/conv.rs
+++ b/crates/rust-analyzer/src/conv.rs
@@ -20,7 +20,7 @@ use ra_vfs::LineEndings;
20 20
21use crate::{ 21use crate::{
22 req, 22 req,
23 semantic_tokens::{self, ModifierSet, BUILTIN, CONTROL, MUTABLE, UNSAFE}, 23 semantic_tokens::{self, ModifierSet, BUILTIN, CONSTANT, CONTROL, MUTABLE, UNSAFE},
24 world::WorldSnapshot, 24 world::WorldSnapshot,
25 Result, 25 Result,
26}; 26};
@@ -322,7 +322,7 @@ impl Conv for Highlight {
322 HighlightTag::Constant => { 322 HighlightTag::Constant => {
323 mods |= SemanticTokenModifier::STATIC; 323 mods |= SemanticTokenModifier::STATIC;
324 mods |= SemanticTokenModifier::READONLY; 324 mods |= SemanticTokenModifier::READONLY;
325 SemanticTokenType::VARIABLE 325 CONSTANT
326 } 326 }
327 HighlightTag::Macro => SemanticTokenType::MACRO, 327 HighlightTag::Macro => SemanticTokenType::MACRO,
328 HighlightTag::Variable => SemanticTokenType::VARIABLE, 328 HighlightTag::Variable => SemanticTokenType::VARIABLE,
diff --git a/crates/rust-analyzer/src/semantic_tokens.rs b/crates/rust-analyzer/src/semantic_tokens.rs
index bf21dc68e..d8362409d 100644
--- a/crates/rust-analyzer/src/semantic_tokens.rs
+++ b/crates/rust-analyzer/src/semantic_tokens.rs
@@ -5,6 +5,7 @@ use std::ops;
5use lsp_types::{Range, SemanticToken, SemanticTokenModifier, SemanticTokenType}; 5use lsp_types::{Range, SemanticToken, SemanticTokenModifier, SemanticTokenType};
6 6
7pub(crate) const ATTRIBUTE: SemanticTokenType = SemanticTokenType::new("attribute"); 7pub(crate) const ATTRIBUTE: SemanticTokenType = SemanticTokenType::new("attribute");
8pub(crate) const CONSTANT: SemanticTokenType = SemanticTokenType::new("constant");
8 9
9pub(crate) const MUTABLE: SemanticTokenModifier = SemanticTokenModifier::new("mutable"); 10pub(crate) const MUTABLE: SemanticTokenModifier = SemanticTokenModifier::new("mutable");
10pub(crate) const UNSAFE: SemanticTokenModifier = SemanticTokenModifier::new("unsafe"); 11pub(crate) const UNSAFE: SemanticTokenModifier = SemanticTokenModifier::new("unsafe");
@@ -33,6 +34,7 @@ pub(crate) const SUPPORTED_TYPES: &[SemanticTokenType] = &[
33 SemanticTokenType::PARAMETER, 34 SemanticTokenType::PARAMETER,
34 SemanticTokenType::LABEL, 35 SemanticTokenType::LABEL,
35 ATTRIBUTE, 36 ATTRIBUTE,
37 CONSTANT,
36]; 38];
37 39
38pub(crate) const SUPPORTED_MODIFIERS: &[SemanticTokenModifier] = &[ 40pub(crate) const SUPPORTED_MODIFIERS: &[SemanticTokenModifier] = &[