aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/to_proto.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-01-20 17:38:12 +0000
committerLukas Wirth <[email protected]>2021-01-20 17:39:46 +0000
commitf2cb7dbcb71d81336c95dc7ae1301ba2a79ef707 (patch)
treec17a9cf589910137b5388fc22856c991a5ec0a31 /crates/rust-analyzer/src/to_proto.rs
parent563a175fdb9073a548fc2e161d5de0a093b0d74d (diff)
Partially unify SymbolKind and CompletionItemKind
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r--crates/rust-analyzer/src/to_proto.rs36
1 files changed, 22 insertions, 14 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 18e8a6d22..96f915f1c 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -91,24 +91,32 @@ pub(crate) fn completion_item_kind(
91 CompletionItemKind::Attribute => lsp_types::CompletionItemKind::EnumMember, 91 CompletionItemKind::Attribute => lsp_types::CompletionItemKind::EnumMember,
92 CompletionItemKind::Binding => lsp_types::CompletionItemKind::Variable, 92 CompletionItemKind::Binding => lsp_types::CompletionItemKind::Variable,
93 CompletionItemKind::BuiltinType => lsp_types::CompletionItemKind::Struct, 93 CompletionItemKind::BuiltinType => lsp_types::CompletionItemKind::Struct,
94 CompletionItemKind::Const => lsp_types::CompletionItemKind::Constant,
95 CompletionItemKind::ConstParam => lsp_types::CompletionItemKind::TypeParameter,
96 CompletionItemKind::Enum => lsp_types::CompletionItemKind::Enum,
97 CompletionItemKind::EnumVariant => lsp_types::CompletionItemKind::EnumMember,
98 CompletionItemKind::Field => lsp_types::CompletionItemKind::Field,
99 CompletionItemKind::Function => lsp_types::CompletionItemKind::Function,
100 CompletionItemKind::Keyword => lsp_types::CompletionItemKind::Keyword, 94 CompletionItemKind::Keyword => lsp_types::CompletionItemKind::Keyword,
101 CompletionItemKind::LifetimeParam => lsp_types::CompletionItemKind::TypeParameter,
102 CompletionItemKind::Macro => lsp_types::CompletionItemKind::Method,
103 CompletionItemKind::Method => lsp_types::CompletionItemKind::Method, 95 CompletionItemKind::Method => lsp_types::CompletionItemKind::Method,
104 CompletionItemKind::Module => lsp_types::CompletionItemKind::Module,
105 CompletionItemKind::Snippet => lsp_types::CompletionItemKind::Snippet, 96 CompletionItemKind::Snippet => lsp_types::CompletionItemKind::Snippet,
106 CompletionItemKind::Static => lsp_types::CompletionItemKind::Value,
107 CompletionItemKind::Struct => lsp_types::CompletionItemKind::Struct,
108 CompletionItemKind::Trait => lsp_types::CompletionItemKind::Interface,
109 CompletionItemKind::TypeAlias => lsp_types::CompletionItemKind::Struct,
110 CompletionItemKind::TypeParam => lsp_types::CompletionItemKind::TypeParameter,
111 CompletionItemKind::UnresolvedReference => lsp_types::CompletionItemKind::Reference, 97 CompletionItemKind::UnresolvedReference => lsp_types::CompletionItemKind::Reference,
98 CompletionItemKind::SymbolKind(symbol) => match symbol {
99 SymbolKind::Const => lsp_types::CompletionItemKind::Constant,
100 SymbolKind::ConstParam => lsp_types::CompletionItemKind::TypeParameter,
101 SymbolKind::Enum => lsp_types::CompletionItemKind::Enum,
102 SymbolKind::Field => lsp_types::CompletionItemKind::Field,
103 SymbolKind::Function => lsp_types::CompletionItemKind::Function,
104 SymbolKind::Impl => lsp_types::CompletionItemKind::Text,
105 SymbolKind::Label => lsp_types::CompletionItemKind::Variable,
106 SymbolKind::LifetimeParam => lsp_types::CompletionItemKind::TypeParameter,
107 SymbolKind::Local => lsp_types::CompletionItemKind::Variable,
108 SymbolKind::Macro => lsp_types::CompletionItemKind::Method,
109 SymbolKind::Module => lsp_types::CompletionItemKind::Module,
110 SymbolKind::SelfParam => lsp_types::CompletionItemKind::Value,
111 SymbolKind::Static => lsp_types::CompletionItemKind::Value,
112 SymbolKind::Struct => lsp_types::CompletionItemKind::Struct,
113 SymbolKind::Trait => lsp_types::CompletionItemKind::Interface,
114 SymbolKind::TypeAlias => lsp_types::CompletionItemKind::Struct,
115 SymbolKind::TypeParam => lsp_types::CompletionItemKind::TypeParameter,
116 SymbolKind::Union => lsp_types::CompletionItemKind::Struct,
117 SymbolKind::ValueParam => lsp_types::CompletionItemKind::Value,
118 SymbolKind::Variant => lsp_types::CompletionItemKind::EnumMember,
119 },
112 } 120 }
113} 121}
114 122