diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-22 15:31:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-22 15:31:47 +0000 |
commit | 0c37b3a0fc6d62cd1401320c53feb51a58ea09a6 (patch) | |
tree | 3798ba62e958b1c3642c30e4fab13011171b4837 /crates/ide/src/display | |
parent | a5322e3d5b813e4bce7a73762c14bebbd9a36e01 (diff) | |
parent | 08b822b25914bea7405a30383fe43c7235d14346 (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/src/display')
-rw-r--r-- | crates/ide/src/display/navigation_target.rs | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index 9c568c90c..16fa828ad 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs | |||
@@ -7,6 +7,7 @@ use hir::{AssocItem, Documentation, FieldSource, HasAttrs, HasSource, InFile, Mo | |||
7 | use ide_db::{ | 7 | use ide_db::{ |
8 | base_db::{FileId, FileRange, SourceDatabase}, | 8 | base_db::{FileId, FileRange, SourceDatabase}, |
9 | symbol_index::FileSymbolKind, | 9 | symbol_index::FileSymbolKind, |
10 | SymbolKind, | ||
10 | }; | 11 | }; |
11 | use ide_db::{defs::Definition, RootDatabase}; | 12 | use ide_db::{defs::Definition, RootDatabase}; |
12 | use syntax::{ | 13 | use syntax::{ |
@@ -18,30 +19,6 @@ use crate::FileSymbol; | |||
18 | 19 | ||
19 | use super::short_label::ShortLabel; | 20 | use super::short_label::ShortLabel; |
20 | 21 | ||
21 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] | ||
22 | pub enum SymbolKind { | ||
23 | Module, | ||
24 | Impl, | ||
25 | Field, | ||
26 | TypeParam, | ||
27 | ConstParam, | ||
28 | LifetimeParam, | ||
29 | ValueParam, | ||
30 | SelfParam, | ||
31 | Local, | ||
32 | Label, | ||
33 | Function, | ||
34 | Const, | ||
35 | Static, | ||
36 | Struct, | ||
37 | Enum, | ||
38 | Variant, | ||
39 | Union, | ||
40 | TypeAlias, | ||
41 | Trait, | ||
42 | Macro, | ||
43 | } | ||
44 | |||
45 | /// `NavigationTarget` represents and element in the editor's UI which you can | 22 | /// `NavigationTarget` represents and element in the editor's UI which you can |
46 | /// click on to navigate to a particular piece of code. | 23 | /// click on to navigate to a particular piece of code. |
47 | /// | 24 | /// |