diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/src/completion.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs index ed1b6dd0c..6d84558d1 100644 --- a/crates/ra_analysis/src/completion.rs +++ b/crates/ra_analysis/src/completion.rs | |||
@@ -41,7 +41,7 @@ pub(crate) fn completions( | |||
41 | reference_completion::completions(&mut res, db, &module, &file, name_ref)?; | 41 | reference_completion::completions(&mut res, db, &module, &file, name_ref)?; |
42 | // special case, `trait T { fn foo(i_am_a_name_ref) {} }` | 42 | // special case, `trait T { fn foo(i_am_a_name_ref) {} }` |
43 | if is_node::<ast::Param>(name_ref.syntax()) { | 43 | if is_node::<ast::Param>(name_ref.syntax()) { |
44 | param_completions(name_ref.syntax(), &mut res); | 44 | param_completions(&mut res, name_ref.syntax()); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
@@ -49,7 +49,7 @@ pub(crate) fn completions( | |||
49 | if let Some(name) = find_node_at_offset::<ast::Name>(file.syntax(), position.offset) { | 49 | if let Some(name) = find_node_at_offset::<ast::Name>(file.syntax(), position.offset) { |
50 | if is_node::<ast::Param>(name.syntax()) { | 50 | if is_node::<ast::Param>(name.syntax()) { |
51 | has_completions = true; | 51 | has_completions = true; |
52 | param_completions(name.syntax(), &mut res); | 52 | param_completions(&mut res, name.syntax()); |
53 | } | 53 | } |
54 | } | 54 | } |
55 | let res = if has_completions { Some(res) } else { None }; | 55 | let res = if has_completions { Some(res) } else { None }; |
@@ -60,7 +60,7 @@ pub(crate) fn completions( | |||
60 | /// functions in a file have a `spam: &mut Spam` parameter, a completion with | 60 | /// functions in a file have a `spam: &mut Spam` parameter, a completion with |
61 | /// `spam: &mut Spam` insert text/label and `spam` lookup string will be | 61 | /// `spam: &mut Spam` insert text/label and `spam` lookup string will be |
62 | /// suggested. | 62 | /// suggested. |
63 | fn param_completions(ctx: SyntaxNodeRef, acc: &mut Vec<CompletionItem>) { | 63 | fn param_completions(acc: &mut Vec<CompletionItem>, ctx: SyntaxNodeRef) { |
64 | let mut params = FxHashMap::default(); | 64 | let mut params = FxHashMap::default(); |
65 | for node in ctx.ancestors() { | 65 | for node in ctx.ancestors() { |
66 | let _ = visitor_ctx(&mut params) | 66 | let _ = visitor_ctx(&mut params) |