diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r-- | crates/ra_ide_api/src/completion/presentation.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 50fdb0043..896ad1517 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs | |||
@@ -224,12 +224,11 @@ impl Completions { | |||
224 | && ctx.db.feature_flags.get("completion.insertion.add-call-parenthesis") | 224 | && ctx.db.feature_flags.get("completion.insertion.add-call-parenthesis") |
225 | { | 225 | { |
226 | tested_by!(inserts_parens_for_function_calls); | 226 | tested_by!(inserts_parens_for_function_calls); |
227 | let (snippet, label) = | 227 | let (snippet, label) = if params.is_empty() || has_self_param && params.len() == 1 { |
228 | if params.is_empty() || has_self_param && params.len() == 1 { | 228 | (format!("{}()$0", func_name), format!("{}()", name)) |
229 | (format!("{}()$0", func_name), format!("{}()", name)) | 229 | } else { |
230 | } else { | 230 | (format!("{}($0)", func_name), format!("{}(…)", name)) |
231 | (format!("{}($0)", func_name), format!("{}(…)", name)) | 231 | }; |
232 | }; | ||
233 | builder = builder.lookup_by(name).label(label).insert_snippet(snippet); | 232 | builder = builder.lookup_by(name).label(label).insert_snippet(snippet); |
234 | } | 233 | } |
235 | 234 | ||