diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/presentation.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/presentation.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index f4ff4404b..973936736 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs | |||
@@ -98,13 +98,13 @@ impl Completions { | |||
98 | name: Option<String>, | 98 | name: Option<String>, |
99 | func: hir::Function, | 99 | func: hir::Function, |
100 | ) { | 100 | ) { |
101 | let sig = func.signature(ctx.db); | 101 | let data = func.data(ctx.db); |
102 | let name = name.unwrap_or_else(|| sig.name().to_string()); | 102 | let name = name.unwrap_or_else(|| data.name().to_string()); |
103 | let ast_node = func.source(ctx.db).ast; | 103 | let ast_node = func.source(ctx.db).ast; |
104 | let detail = function_label(&ast_node); | 104 | let detail = function_label(&ast_node); |
105 | 105 | ||
106 | let mut builder = CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name) | 106 | let mut builder = CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name) |
107 | .kind(if sig.has_self_param() { | 107 | .kind(if data.has_self_param() { |
108 | CompletionItemKind::Method | 108 | CompletionItemKind::Method |
109 | } else { | 109 | } else { |
110 | CompletionItemKind::Function | 110 | CompletionItemKind::Function |
@@ -115,10 +115,10 @@ impl Completions { | |||
115 | if ctx.use_item_syntax.is_none() && !ctx.is_call { | 115 | if ctx.use_item_syntax.is_none() && !ctx.is_call { |
116 | tested_by!(inserts_parens_for_function_calls); | 116 | tested_by!(inserts_parens_for_function_calls); |
117 | let snippet = | 117 | let snippet = |
118 | if sig.params().is_empty() || sig.has_self_param() && sig.params().len() == 1 { | 118 | if data.params().is_empty() || data.has_self_param() && data.params().len() == 1 { |
119 | format!("{}()$0", sig.name()) | 119 | format!("{}()$0", data.name()) |
120 | } else { | 120 | } else { |
121 | format!("{}($0)", sig.name()) | 121 | format!("{}($0)", data.name()) |
122 | }; | 122 | }; |
123 | builder = builder.insert_snippet(snippet); | 123 | builder = builder.insert_snippet(snippet); |
124 | } | 124 | } |