diff options
author | Chetan Khilosiya <[email protected]> | 2021-04-05 19:39:17 +0100 |
---|---|---|
committer | Chetan Khilosiya <[email protected]> | 2021-04-08 18:28:26 +0100 |
commit | 1735b3ef6a7c7f7b3f5cdecdbf204c85991bcd63 (patch) | |
tree | 2f0cb9fd6643eaa6433f452e1aa4021b6bc19ab0 /crates/rust-analyzer/src/to_proto.rs | |
parent | 5f279d57f0cba600eae8c550654a00b4268812ac (diff) |
8279: Added initial implementation for
Operator semantic highlighting.
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 2ac31d981..df9292f8e 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -7,9 +7,9 @@ use std::{ | |||
7 | use ide::{ | 7 | use ide::{ |
8 | Annotation, AnnotationKind, Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, | 8 | Annotation, AnnotationKind, Assist, AssistKind, CallInfo, CompletionItem, CompletionItemKind, |
9 | CompletionRelevance, Documentation, FileId, FileRange, FileSystemEdit, Fold, FoldKind, | 9 | CompletionRelevance, Documentation, FileId, FileRange, FileSystemEdit, Fold, FoldKind, |
10 | Highlight, HlMod, HlPunct, HlRange, HlTag, Indel, InlayHint, InlayKind, InsertTextFormat, | 10 | Highlight, HlMod, HlOperator, HlPunct, HlRange, HlTag, Indel, InlayHint, InlayKind, |
11 | Markup, NavigationTarget, ReferenceAccess, RenameError, Runnable, Severity, SourceChange, | 11 | InsertTextFormat, Markup, NavigationTarget, ReferenceAccess, RenameError, Runnable, Severity, |
12 | StructureNodeKind, SymbolKind, TextEdit, TextRange, TextSize, | 12 | SourceChange, StructureNodeKind, SymbolKind, TextEdit, TextRange, TextSize, |
13 | }; | 13 | }; |
14 | use itertools::Itertools; | 14 | use itertools::Itertools; |
15 | use serde_json::to_value; | 15 | use serde_json::to_value; |
@@ -445,7 +445,13 @@ fn semantic_token_type_and_modifiers( | |||
445 | HlTag::FormatSpecifier => semantic_tokens::FORMAT_SPECIFIER, | 445 | HlTag::FormatSpecifier => semantic_tokens::FORMAT_SPECIFIER, |
446 | HlTag::Keyword => lsp_types::SemanticTokenType::KEYWORD, | 446 | HlTag::Keyword => lsp_types::SemanticTokenType::KEYWORD, |
447 | HlTag::None => semantic_tokens::GENERIC, | 447 | HlTag::None => semantic_tokens::GENERIC, |
448 | HlTag::Operator => lsp_types::SemanticTokenType::OPERATOR, | 448 | HlTag::Operator(op) => match op { |
449 | HlOperator::Bitwise => semantic_tokens::BITWISE, | ||
450 | HlOperator::Arithmetic => semantic_tokens::ARITHMETIC, | ||
451 | HlOperator::Logical => semantic_tokens::LOGICAL, | ||
452 | HlOperator::Comparision => semantic_tokens::COMPARISION, | ||
453 | HlOperator::Other => semantic_tokens::OPERATOR, | ||
454 | }, | ||
449 | HlTag::StringLiteral => lsp_types::SemanticTokenType::STRING, | 455 | HlTag::StringLiteral => lsp_types::SemanticTokenType::STRING, |
450 | HlTag::UnresolvedReference => semantic_tokens::UNRESOLVED_REFERENCE, | 456 | HlTag::UnresolvedReference => semantic_tokens::UNRESOLVED_REFERENCE, |
451 | HlTag::Punctuation(punct) => match punct { | 457 | HlTag::Punctuation(punct) => match punct { |