From 821f5186ba0f2dd584234df440e1407cb432c928 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 16:08:58 +0300 Subject: use real signature in completion --- crates/ra_analysis/src/completion/completion_item.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'crates/ra_analysis/src/completion') diff --git a/crates/ra_analysis/src/completion/completion_item.rs b/crates/ra_analysis/src/completion/completion_item.rs index cd4d529f9..a25b87bee 100644 --- a/crates/ra_analysis/src/completion/completion_item.rs +++ b/crates/ra_analysis/src/completion/completion_item.rs @@ -150,12 +150,10 @@ impl Builder { fn from_function(mut self, ctx: &CompletionContext, function: hir::Function) -> Builder { // If not an import, add parenthesis automatically. if ctx.use_item_syntax.is_none() { - if let Some(sig_info) = function.signature_info(ctx.db) { - if sig_info.params.is_empty() { - self.snippet = Some(format!("{}()$0", self.label)); - } else { - self.snippet = Some(format!("{}($0)", self.label)); - } + if function.signature(ctx.db).args().is_empty() { + self.snippet = Some(format!("{}()$0", self.label)); + } else { + self.snippet = Some(format!("{}($0)", self.label)); } } self.kind = Some(CompletionItemKind::Function); -- cgit v1.2.3