aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/presentation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/completion/presentation.rs')
-rw-r--r--crates/ra_ide/src/completion/presentation.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs
index aada4d025..25aff329e 100644
--- a/crates/ra_ide/src/completion/presentation.rs
+++ b/crates/ra_ide/src/completion/presentation.rs
@@ -212,21 +212,14 @@ impl Completions {
212 .detail(function_signature.to_string()); 212 .detail(function_signature.to_string());
213 213
214 // If not an import, add parenthesis automatically. 214 // If not an import, add parenthesis automatically.
215 if ctx.use_item_syntax.is_none() 215 if ctx.use_item_syntax.is_none() && !ctx.is_call && ctx.options.add_call_parenthesis {
216 && !ctx.is_call
217 && ctx.db.feature_flags.get("completion.insertion.add-call-parenthesis")
218 {
219 tested_by!(inserts_parens_for_function_calls); 216 tested_by!(inserts_parens_for_function_calls);
220 217
221 let (snippet, label) = if params.is_empty() || has_self_param && params.len() == 1 { 218 let (snippet, label) = if params.is_empty() || has_self_param && params.len() == 1 {
222 (format!("{}()$0", name), format!("{}()", name)) 219 (format!("{}()$0", name), format!("{}()", name))
223 } else { 220 } else {
224 builder = builder.trigger_call_info(); 221 builder = builder.trigger_call_info();
225 let snippet = if ctx 222 let snippet = if ctx.options.add_call_argument_snippets {
226 .db
227 .feature_flags
228 .get("completion.insertion.add-argument-snippets")
229 {
230 let to_skip = if has_self_param { 1 } else { 0 }; 223 let to_skip = if has_self_param { 1 } else { 0 };
231 let function_params_snippet = join( 224 let function_params_snippet = join(
232 function_signature.parameter_names.iter().skip(to_skip).enumerate().map( 225 function_signature.parameter_names.iter().skip(to_skip).enumerate().map(