aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-08 13:08:58 +0000
committerAleksey Kladov <[email protected]>2019-01-08 13:08:58 +0000
commit821f5186ba0f2dd584234df440e1407cb432c928 (patch)
tree82afb0e58855e18bc25bb39ea11db414d57ed5dc /crates
parent6ba4fa0bc77fddf11e4938c6d79e911a91054a45 (diff)
use real signature in completion
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_analysis/src/completion/completion_item.rs10
1 files changed, 4 insertions, 6 deletions
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 {
150 fn from_function(mut self, ctx: &CompletionContext, function: hir::Function) -> Builder { 150 fn from_function(mut self, ctx: &CompletionContext, function: hir::Function) -> Builder {
151 // If not an import, add parenthesis automatically. 151 // If not an import, add parenthesis automatically.
152 if ctx.use_item_syntax.is_none() { 152 if ctx.use_item_syntax.is_none() {
153 if let Some(sig_info) = function.signature_info(ctx.db) { 153 if function.signature(ctx.db).args().is_empty() {
154 if sig_info.params.is_empty() { 154 self.snippet = Some(format!("{}()$0", self.label));
155 self.snippet = Some(format!("{}()$0", self.label)); 155 } else {
156 } else { 156 self.snippet = Some(format!("{}($0)", self.label));
157 self.snippet = Some(format!("{}($0)", self.label));
158 }
159 } 157 }
160 } 158 }
161 self.kind = Some(CompletionItemKind::Function); 159 self.kind = Some(CompletionItemKind::Function);