aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis')
-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);