aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-26 17:32:13 +0000
committerGitHub <[email protected]>2020-02-26 17:32:13 +0000
commitd1e7a20c00b90f9c032d55642cda8650bba28731 (patch)
treebce8ebbb3125794d1717d415810868b022d6a4b0 /crates
parent913cdcee8f0fe4373627d10d756949b970bcf5c2 (diff)
parent2a2d289e5f72a1698282aee572bda1b7119bc084 (diff)
Merge pull request #3327 from matklad/bitsetoops
Fix bitset ops
Diffstat (limited to 'crates')
-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)