diff options
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index e88818eb0..ab742a17c 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -11,7 +11,7 @@ use ide::{ | |||
11 | Markup, NavigationTarget, ReferenceAccess, RenameError, Runnable, Severity, SourceChange, | 11 | Markup, NavigationTarget, ReferenceAccess, RenameError, Runnable, Severity, SourceChange, |
12 | TextEdit, TextRange, TextSize, | 12 | TextEdit, TextRange, TextSize, |
13 | }; | 13 | }; |
14 | use ide_db::SymbolKind; | 14 | use ide_db::{StructureNodeKind, SymbolKind}; |
15 | use itertools::Itertools; | 15 | use itertools::Itertools; |
16 | use serde_json::to_value; | 16 | use serde_json::to_value; |
17 | 17 | ||
@@ -60,7 +60,13 @@ pub(crate) fn symbol_kind(symbol_kind: SymbolKind) -> lsp_types::SymbolKind { | |||
60 | | SymbolKind::ValueParam | 60 | | SymbolKind::ValueParam |
61 | | SymbolKind::Label => lsp_types::SymbolKind::Variable, | 61 | | SymbolKind::Label => lsp_types::SymbolKind::Variable, |
62 | SymbolKind::Union => lsp_types::SymbolKind::Struct, | 62 | SymbolKind::Union => lsp_types::SymbolKind::Struct, |
63 | SymbolKind::Region => lsp_types::SymbolKind::Namespace, | 63 | } |
64 | } | ||
65 | |||
66 | pub(crate) fn structure_node_kind(kind: StructureNodeKind) -> lsp_types::SymbolKind { | ||
67 | match kind { | ||
68 | StructureNodeKind::SymbolKind(symbol) => symbol_kind(symbol), | ||
69 | StructureNodeKind::Region => lsp_types::SymbolKind::Namespace, | ||
64 | } | 70 | } |
65 | } | 71 | } |
66 | 72 | ||
@@ -118,7 +124,6 @@ pub(crate) fn completion_item_kind( | |||
118 | SymbolKind::Local => lsp_types::CompletionItemKind::Variable, | 124 | SymbolKind::Local => lsp_types::CompletionItemKind::Variable, |
119 | SymbolKind::Macro => lsp_types::CompletionItemKind::Method, | 125 | SymbolKind::Macro => lsp_types::CompletionItemKind::Method, |
120 | SymbolKind::Module => lsp_types::CompletionItemKind::Module, | 126 | SymbolKind::Module => lsp_types::CompletionItemKind::Module, |
121 | SymbolKind::Region => lsp_types::CompletionItemKind::Keyword, | ||
122 | SymbolKind::SelfParam => lsp_types::CompletionItemKind::Value, | 127 | SymbolKind::SelfParam => lsp_types::CompletionItemKind::Value, |
123 | SymbolKind::Static => lsp_types::CompletionItemKind::Value, | 128 | SymbolKind::Static => lsp_types::CompletionItemKind::Value, |
124 | SymbolKind::Struct => lsp_types::CompletionItemKind::Struct, | 129 | SymbolKind::Struct => lsp_types::CompletionItemKind::Struct, |
@@ -430,7 +435,6 @@ fn semantic_token_type_and_modifiers( | |||
430 | SymbolKind::TypeAlias => semantic_tokens::TYPE_ALIAS, | 435 | SymbolKind::TypeAlias => semantic_tokens::TYPE_ALIAS, |
431 | SymbolKind::Trait => lsp_types::SemanticTokenType::INTERFACE, | 436 | SymbolKind::Trait => lsp_types::SemanticTokenType::INTERFACE, |
432 | SymbolKind::Macro => lsp_types::SemanticTokenType::MACRO, | 437 | SymbolKind::Macro => lsp_types::SemanticTokenType::MACRO, |
433 | SymbolKind::Region => lsp_types::SemanticTokenType::NAMESPACE, | ||
434 | }, | 438 | }, |
435 | HlTag::BuiltinType => semantic_tokens::BUILTIN_TYPE, | 439 | HlTag::BuiltinType => semantic_tokens::BUILTIN_TYPE, |
436 | HlTag::None => semantic_tokens::GENERIC, | 440 | HlTag::None => semantic_tokens::GENERIC, |