diff options
author | Benjamin Coenen <[email protected]> | 2020-04-17 09:59:04 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-04-17 09:59:04 +0100 |
commit | 379787858bbfb2691e134942d94fcbc70c5d1d7f (patch) | |
tree | bdd00e7636f7e89f38a0bc601899a27038140f5b /crates/ra_ide/src/completion | |
parent | 18802ebe41eb88688c6619b3a975b73d2823baea (diff) |
feat: improve dot completions with scoring
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index dd9cc7daa..46e243192 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -11,7 +11,7 @@ use ra_syntax::{ | |||
11 | }; | 11 | }; |
12 | use ra_text_edit::AtomTextEdit; | 12 | use ra_text_edit::AtomTextEdit; |
13 | 13 | ||
14 | use crate::{call_info::call_info, completion::CompletionConfig, CallInfo, FilePosition}; | 14 | use crate::{completion::CompletionConfig, FilePosition}; |
15 | 15 | ||
16 | /// `CompletionContext` is created early during completion to figure out, where | 16 | /// `CompletionContext` is created early during completion to figure out, where |
17 | /// exactly is the cursor, syntax-wise. | 17 | /// exactly is the cursor, syntax-wise. |
@@ -34,7 +34,6 @@ pub(crate) struct CompletionContext<'a> { | |||
34 | pub(super) record_pat_syntax: Option<ast::RecordPat>, | 34 | pub(super) record_pat_syntax: Option<ast::RecordPat>, |
35 | pub(super) record_field_syntax: Option<ast::RecordField>, | 35 | pub(super) record_field_syntax: Option<ast::RecordField>, |
36 | pub(super) impl_def: Option<ast::ImplDef>, | 36 | pub(super) impl_def: Option<ast::ImplDef>, |
37 | pub(super) call_info: Option<CallInfo>, | ||
38 | pub(super) is_param: bool, | 37 | pub(super) is_param: bool, |
39 | /// If a name-binding or reference to a const in a pattern. | 38 | /// If a name-binding or reference to a const in a pattern. |
40 | /// Irrefutable patterns (like let) are excluded. | 39 | /// Irrefutable patterns (like let) are excluded. |
@@ -95,7 +94,6 @@ impl<'a> CompletionContext<'a> { | |||
95 | krate, | 94 | krate, |
96 | name_ref_syntax: None, | 95 | name_ref_syntax: None, |
97 | function_syntax: None, | 96 | function_syntax: None, |
98 | call_info: None, | ||
99 | use_item_syntax: None, | 97 | use_item_syntax: None, |
100 | record_lit_syntax: None, | 98 | record_lit_syntax: None, |
101 | record_pat_syntax: None, | 99 | record_pat_syntax: None, |
@@ -268,8 +266,6 @@ impl<'a> CompletionContext<'a> { | |||
268 | self.use_item_syntax = | 266 | self.use_item_syntax = |
269 | self.sema.ancestors_with_macros(self.token.parent()).find_map(ast::UseItem::cast); | 267 | self.sema.ancestors_with_macros(self.token.parent()).find_map(ast::UseItem::cast); |
270 | 268 | ||
271 | self.call_info = call_info(self.db, self.file_position); | ||
272 | |||
273 | self.function_syntax = self | 269 | self.function_syntax = self |
274 | .sema | 270 | .sema |
275 | .ancestors_with_macros(self.token.parent()) | 271 | .ancestors_with_macros(self.token.parent()) |