aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-21 11:02:51 +0000
committerAleksey Kladov <[email protected]>2018-12-21 11:02:51 +0000
commitb0ff6176ed0401251ae9f84d115a888fa4baee89 (patch)
treefc98be9d820e6b4b1801091f21c2ca76f5425f80
parent74406ca8ea45df8b44cb38ecba4a5b561038c4a0 (diff)
flip params
-rw-r--r--crates/ra_analysis/src/completion.rs6
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.
63fn param_completions(ctx: SyntaxNodeRef, acc: &mut Vec<CompletionItem>) { 63fn 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)