diff options
author | Aleksey Kladov <[email protected]> | 2020-02-26 17:09:49 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-26 17:09:49 +0000 |
commit | 2a2d289e5f72a1698282aee572bda1b7119bc084 (patch) | |
tree | a53f9c09ebbb59ede670243e8eb55cf9d469d6fc | |
parent | 6ea633c4940d25acea04e4945a8f905e65153c30 (diff) |
Fix bitset ops
-rw-r--r-- | crates/rust-analyzer/src/conv.rs | 5 |
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) |