aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/to_proto.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-01-10 12:33:03 +0000
committerLukas Wirth <[email protected]>2021-01-10 12:33:03 +0000
commit78fe6133c4908aefcf5c690e665abba9ef2389eb (patch)
treed739ed531d649ec9c910d47a69d1ce79df78a749 /crates/rust-analyzer/src/to_proto.rs
parent6a0a47dd1492975959f6719202c3fb175df0349c (diff)
Split punctuation semantic highlighting up into more tags
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r--crates/rust-analyzer/src/to_proto.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index d6bf60cde..bdddca9da 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -6,9 +6,9 @@ use std::{
6 6
7use ide::{ 7use ide::{
8 Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, Documentation, FileId, 8 Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, Documentation, FileId,
9 FileRange, FileSystemEdit, Fold, FoldKind, Highlight, HlMod, HlRange, HlTag, Indel, InlayHint, 9 FileRange, FileSystemEdit, Fold, FoldKind, Highlight, HlMod, HlPunct, HlRange, HlTag, Indel,
10 InlayKind, InsertTextFormat, LineIndex, Markup, NavigationTarget, ReferenceAccess, Runnable, 10 InlayHint, InlayKind, InsertTextFormat, LineIndex, Markup, NavigationTarget, ReferenceAccess,
11 Severity, SourceChange, SourceFileEdit, SymbolKind, TextEdit, TextRange, TextSize, 11 Runnable, Severity, SourceChange, SourceFileEdit, SymbolKind, TextEdit, TextRange, TextSize,
12}; 12};
13use itertools::Itertools; 13use itertools::Itertools;
14 14
@@ -423,7 +423,17 @@ fn semantic_token_type_and_modifiers(
423 HlTag::FormatSpecifier => semantic_tokens::FORMAT_SPECIFIER, 423 HlTag::FormatSpecifier => semantic_tokens::FORMAT_SPECIFIER,
424 HlTag::Operator => lsp_types::SemanticTokenType::OPERATOR, 424 HlTag::Operator => lsp_types::SemanticTokenType::OPERATOR,
425 HlTag::EscapeSequence => semantic_tokens::ESCAPE_SEQUENCE, 425 HlTag::EscapeSequence => semantic_tokens::ESCAPE_SEQUENCE,
426 HlTag::Punctuation => semantic_tokens::PUNCTUATION, 426 HlTag::Punctuation(punct) => match punct {
427 HlPunct::Bracket => semantic_tokens::BRACKET,
428 HlPunct::Brace => semantic_tokens::BRACE,
429 HlPunct::Parenthesis => semantic_tokens::PARENTHESIS,
430 HlPunct::Angle => semantic_tokens::ANGLE,
431 HlPunct::Comma => semantic_tokens::COMMA,
432 HlPunct::Dot => semantic_tokens::DOT,
433 HlPunct::Colon => semantic_tokens::COLON,
434 HlPunct::Semi => semantic_tokens::SEMICOLON,
435 HlPunct::Other => semantic_tokens::PUNCTUATION,
436 },
427 }; 437 };
428 438
429 for modifier in highlight.mods.iter() { 439 for modifier in highlight.mods.iter() {