aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/to_proto.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-07 22:39:02 +0000
committerAleksey Kladov <[email protected]>2021-01-08 20:47:35 +0000
commite30c1c3fbf8f70336d985b2b73e5b0f45f3b95f5 (patch)
treea3cdc2d2f667ab5a122758152eb338a654d387cd /crates/rust-analyzer/src/to_proto.rs
parent981a0d708ec352969f9ca075a3e0e50c6da48197 (diff)
Simplify highlighting infra
This also fixes the killer whale bug
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r--crates/rust-analyzer/src/to_proto.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index bc9999ddc..204cae265 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -343,6 +343,9 @@ pub(crate) fn semantic_tokens(
343 let mut builder = semantic_tokens::SemanticTokensBuilder::new(id); 343 let mut builder = semantic_tokens::SemanticTokensBuilder::new(id);
344 344
345 for highlight_range in highlights { 345 for highlight_range in highlights {
346 if highlight_range.highlight.is_empty() {
347 continue;
348 }
346 let (type_, mods) = semantic_token_type_and_modifiers(highlight_range.highlight); 349 let (type_, mods) = semantic_token_type_and_modifiers(highlight_range.highlight);
347 let token_index = semantic_tokens::type_index(type_); 350 let token_index = semantic_tokens::type_index(type_);
348 let modifier_bitset = mods.0; 351 let modifier_bitset = mods.0;