From 2a2d289e5f72a1698282aee572bda1b7119bc084 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 26 Feb 2020 18:09:49 +0100 Subject: Fix bitset ops --- crates/rust-analyzer/src/conv.rs | 5 +++-- 1 file 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 { } HighlightTag::LITERAL_STRING => SemanticTokenType::STRING, - HighlightTag::LITERAL_ATTRIBUTE => SemanticTokenType::KEYWORD, + HighlightTag::LITERAL_ATTRIBUTE => "attribute".into(), HighlightTag::KEYWORD => SemanticTokenType::KEYWORD, HighlightTag::KEYWORD_UNSAFE => SemanticTokenType::KEYWORD, @@ -363,10 +363,11 @@ impl Conv for (SemanticTokenType, Vec) { semantic_tokens::supported_token_types().iter().position(|it| *it == self.0).unwrap(); let mut token_modifier_bitset = 0; for modifier in self.1.iter() { - token_modifier_bitset |= semantic_tokens::supported_token_modifiers() + let modifier_index = semantic_tokens::supported_token_modifiers() .iter() .position(|it| it == modifier) .unwrap(); + token_modifier_bitset |= 1 << modifier_index; } (token_index as u32, token_modifier_bitset as u32) -- cgit v1.2.3