aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-22 15:31:47 +0000
committerGitHub <[email protected]>2021-01-22 15:31:47 +0000
commit0c37b3a0fc6d62cd1401320c53feb51a58ea09a6 (patch)
tree3798ba62e958b1c3642c30e4fab13011171b4837 /crates/ide_db
parenta5322e3d5b813e4bce7a73762c14bebbd9a36e01 (diff)
parent08b822b25914bea7405a30383fe43c7235d14346 (diff)
Merge #7353
7353: Add LifetimeParam and ConstParam to CompletionItemKind r=matklad a=Veykril Adds `LifetimeParam` and `ConstParam` to `CompletionItemKind` and maps them both to `TypeParam` in the protocol conversion as there are no equivalents, so nothing really changes there. `ConstParam` could be mapped to `Const` I guess but I'm split on whether that would be better? Additions were solely inspired by (the single) test output for const params. Also sorts the variants of `CompletionItemKind` and its to_proto match. Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide_db')
-rw-r--r--crates/ide_db/src/lib.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ide_db/src/lib.rs b/crates/ide_db/src/lib.rs
index 118c090d7..6eb34b06b 100644
--- a/crates/ide_db/src/lib.rs
+++ b/crates/ide_db/src/lib.rs
@@ -134,3 +134,27 @@ fn line_index(db: &dyn LineIndexDatabase, file_id: FileId) -> Arc<LineIndex> {
134 let text = db.file_text(file_id); 134 let text = db.file_text(file_id);
135 Arc::new(LineIndex::new(&*text)) 135 Arc::new(LineIndex::new(&*text))
136} 136}
137
138#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
139pub enum SymbolKind {
140 Const,
141 ConstParam,
142 Enum,
143 Field,
144 Function,
145 Impl,
146 Label,
147 LifetimeParam,
148 Local,
149 Macro,
150 Module,
151 SelfParam,
152 Static,
153 Struct,
154 Trait,
155 TypeAlias,
156 TypeParam,
157 Union,
158 ValueParam,
159 Variant,
160}