aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/rust-analyzer/src/conv.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/conv.rs b/crates/rust-analyzer/src/conv.rs
index 5e5610a1e..220e0572a 100644
--- a/crates/rust-analyzer/src/conv.rs
+++ b/crates/rust-analyzer/src/conv.rs
@@ -343,7 +343,7 @@ impl Conv for HighlightTag {
343 } 343 }
344 344
345 HighlightTag::LITERAL_STRING => SemanticTokenType::STRING, 345 HighlightTag::LITERAL_STRING => SemanticTokenType::STRING,
346 HighlightTag::LITERAL_ATTRIBUTE => SemanticTokenType::KEYWORD, 346 HighlightTag::LITERAL_ATTRIBUTE => "attribute".into(),
347 347
348 HighlightTag::KEYWORD => SemanticTokenType::KEYWORD, 348 HighlightTag::KEYWORD => SemanticTokenType::KEYWORD,
349 HighlightTag::KEYWORD_UNSAFE => SemanticTokenType::KEYWORD, 349 HighlightTag::KEYWORD_UNSAFE => SemanticTokenType::KEYWORD,
@@ -363,10 +363,11 @@ impl Conv for (SemanticTokenType, Vec<SemanticTokenModifier>) {
363 semantic_tokens::supported_token_types().iter().position(|it| *it == self.0).unwrap(); 363 semantic_tokens::supported_token_types().iter().position(|it| *it == self.0).unwrap();
364 let mut token_modifier_bitset = 0; 364 let mut token_modifier_bitset = 0;
365 for modifier in self.1.iter() { 365 for modifier in self.1.iter() {
366 token_modifier_bitset |= semantic_tokens::supported_token_modifiers() 366 let modifier_index = semantic_tokens::supported_token_modifiers()
367 .iter() 367 .iter()
368 .position(|it| it == modifier) 368 .position(|it| it == modifier)
369 .unwrap(); 369 .unwrap();
370 token_modifier_bitset |= 1 << modifier_index;
370 } 371 }
371 372
372 (token_index as u32, token_modifier_bitset as u32) 373 (token_index as u32, token_modifier_bitset as u32)