aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/render/function.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/completion/src/render/function.rs')
-rw-r--r--crates/completion/src/render/function.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/completion/src/render/function.rs b/crates/completion/src/render/function.rs
index 8f4c66211..e46e21d24 100644
--- a/crates/completion/src/render/function.rs
+++ b/crates/completion/src/render/function.rs
@@ -1,7 +1,8 @@
1//! Renderer for function calls. 1//! Renderer for function calls.
2 2
3use hir::{HasSource, Type}; 3use hir::{HasSource, HirDisplay, Type};
4use syntax::{ast::Fn, display::function_declaration}; 4use ide_db::SymbolKind;
5use syntax::ast::Fn;
5use test_utils::mark; 6use test_utils::mark;
6 7
7use crate::{ 8use crate::{
@@ -54,7 +55,8 @@ impl<'a> FunctionRender<'a> {
54 } 55 }
55 56
56 fn detail(&self) -> String { 57 fn detail(&self) -> String {
57 function_declaration(&self.ast_node) 58 let ty = self.func.ret_type(self.ctx.db());
59 format!("-> {}", ty.display(self.ctx.db()))
58 } 60 }
59 61
60 fn add_arg(&self, arg: &str, ty: &Type) -> String { 62 fn add_arg(&self, arg: &str, ty: &Type) -> String {
@@ -105,7 +107,7 @@ impl<'a> FunctionRender<'a> {
105 if self.func.self_param(self.ctx.db()).is_some() { 107 if self.func.self_param(self.ctx.db()).is_some() {
106 CompletionItemKind::Method 108 CompletionItemKind::Method
107 } else { 109 } else {
108 CompletionItemKind::Function 110 SymbolKind::Function.into()
109 } 111 }
110 } 112 }
111} 113}