aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 13:10:18 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 13:10:18 +0000
commit958c2a2d639130042d927ef6bfa58e82f839314f (patch)
tree82afb0e58855e18bc25bb39ea11db414d57ed5dc
parent6ba4fa0bc77fddf11e4938c6d79e911a91054a45 (diff)
parent821f5186ba0f2dd584234df440e1407cb432c928 (diff)
Merge #459
459: use real signature in completion r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
-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);