aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_editor/src/completion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_editor/src/completion.rs')
-rw-r--r--crates/ra_editor/src/completion.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_editor/src/completion.rs b/crates/ra_editor/src/completion.rs
index 570d72d66..20b8484b3 100644
--- a/crates/ra_editor/src/completion.rs
+++ b/crates/ra_editor/src/completion.rs
@@ -1,4 +1,4 @@
1use std::collections::{HashSet, HashMap}; 1use rustc_hash::{FxHashMap, FxHashSet};
2 2
3use ra_syntax::{ 3use ra_syntax::{
4 File, TextUnit, AstNode, SyntaxNodeRef, SyntaxKind::*, 4 File, TextUnit, AstNode, SyntaxNodeRef, SyntaxKind::*,
@@ -96,7 +96,7 @@ fn complete_name_ref(file: &File, name_ref: ast::NameRef, acc: &mut Vec<Completi
96} 96}
97 97
98fn param_completions(ctx: SyntaxNodeRef, acc: &mut Vec<CompletionItem>) { 98fn param_completions(ctx: SyntaxNodeRef, acc: &mut Vec<CompletionItem>) {
99 let mut params = HashMap::new(); 99 let mut params = FxHashMap::default();
100 for node in ctx.ancestors() { 100 for node in ctx.ancestors() {
101 let _ = visitor_ctx(&mut params) 101 let _ = visitor_ctx(&mut params)
102 .visit::<ast::Root, _>(process) 102 .visit::<ast::Root, _>(process)
@@ -114,7 +114,7 @@ fn param_completions(ctx: SyntaxNodeRef, acc: &mut Vec<CompletionItem>) {
114 }) 114 })
115 }); 115 });
116 116
117 fn process<'a, N: ast::FnDefOwner<'a>>(node: N, params: &mut HashMap<String, (u32, ast::Param<'a>)>) { 117 fn process<'a, N: ast::FnDefOwner<'a>>(node: N, params: &mut FxHashMap<String, (u32, ast::Param<'a>)>) {
118 node.functions() 118 node.functions()
119 .filter_map(|it| it.param_list()) 119 .filter_map(|it| it.param_list())
120 .flat_map(|it| it.params()) 120 .flat_map(|it| it.params())
@@ -232,7 +232,7 @@ fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) {
232} 232}
233 233
234fn complete_fn(name_ref: ast::NameRef, scopes: &FnScopes, acc: &mut Vec<CompletionItem>) { 234fn complete_fn(name_ref: ast::NameRef, scopes: &FnScopes, acc: &mut Vec<CompletionItem>) {
235 let mut shadowed = HashSet::new(); 235 let mut shadowed = FxHashSet::default();
236 acc.extend( 236 acc.extend(
237 scopes.scope_chain(name_ref.syntax()) 237 scopes.scope_chain(name_ref.syntax())
238 .flat_map(|scope| scopes.entries(scope).iter()) 238 .flat_map(|scope| scopes.entries(scope).iter())