diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/completion_item.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_item.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs index e7fa967a0..b75d65de3 100644 --- a/crates/ra_ide_api/src/completion/completion_item.rs +++ b/crates/ra_ide_api/src/completion/completion_item.rs | |||
@@ -37,6 +37,7 @@ pub enum CompletionItemKind { | |||
37 | Const, | 37 | Const, |
38 | Trait, | 38 | Trait, |
39 | TypeAlias, | 39 | TypeAlias, |
40 | Method, | ||
40 | } | 41 | } |
41 | 42 | ||
42 | #[derive(Debug, PartialEq, Eq)] | 43 | #[derive(Debug, PartialEq, Eq)] |
@@ -183,10 +184,14 @@ impl Builder { | |||
183 | self | 184 | self |
184 | } | 185 | } |
185 | 186 | ||
186 | fn from_function(mut self, ctx: &CompletionContext, function: hir::Function) -> Builder { | 187 | pub(super) fn from_function( |
188 | mut self, | ||
189 | ctx: &CompletionContext, | ||
190 | function: hir::Function, | ||
191 | ) -> Builder { | ||
187 | // If not an import, add parenthesis automatically. | 192 | // If not an import, add parenthesis automatically. |
188 | if ctx.use_item_syntax.is_none() && !ctx.is_call { | 193 | if ctx.use_item_syntax.is_none() && !ctx.is_call { |
189 | if function.signature(ctx.db).args().is_empty() { | 194 | if function.signature(ctx.db).params().is_empty() { |
190 | self.snippet = Some(format!("{}()$0", self.label)); | 195 | self.snippet = Some(format!("{}()$0", self.label)); |
191 | } else { | 196 | } else { |
192 | self.snippet = Some(format!("{}($0)", self.label)); | 197 | self.snippet = Some(format!("{}($0)", self.label)); |