aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/render/function.rs
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/completion/src/render/function.rs
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/completion/src/render/function.rs')
-rw-r--r--crates/completion/src/render/function.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/completion/src/render/function.rs b/crates/completion/src/render/function.rs
index 8f4c66211..2d616b1fb 100644
--- a/crates/completion/src/render/function.rs
+++ b/crates/completion/src/render/function.rs
@@ -1,6 +1,7 @@
1//! Renderer for function calls. 1//! Renderer for function calls.
2 2
3use hir::{HasSource, Type}; 3use hir::{HasSource, Type};
4use ide_db::SymbolKind;
4use syntax::{ast::Fn, display::function_declaration}; 5use syntax::{ast::Fn, display::function_declaration};
5use test_utils::mark; 6use test_utils::mark;
6 7
@@ -105,7 +106,7 @@ impl<'a> FunctionRender<'a> {
105 if self.func.self_param(self.ctx.db()).is_some() { 106 if self.func.self_param(self.ctx.db()).is_some() {
106 CompletionItemKind::Method 107 CompletionItemKind::Method
107 } else { 108 } else {
108 CompletionItemKind::Function 109 SymbolKind::Function.into()
109 } 110 }
110 } 111 }
111} 112}