aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/imp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r--crates/ra_analysis/src/imp.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index 517867e86..47bc0032b 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -4,11 +4,12 @@ use std::{
4 atomic::{AtomicBool, Ordering::SeqCst}, 4 atomic::{AtomicBool, Ordering::SeqCst},
5 }, 5 },
6 fmt, 6 fmt,
7 collections::{HashSet, VecDeque}, 7 collections::VecDeque,
8 iter, 8 iter,
9}; 9};
10 10
11use relative_path::RelativePath; 11use relative_path::RelativePath;
12use rustc_hash::FxHashSet;
12use ra_editor::{self, FileSymbol, LineIndex, find_node_at_offset, LocalEdit, resolve_local_name}; 13use ra_editor::{self, FileSymbol, LineIndex, find_node_at_offset, LocalEdit, resolve_local_name};
13use ra_syntax::{ 14use ra_syntax::{
14 TextUnit, TextRange, SmolStr, File, AstNode, 15 TextUnit, TextRange, SmolStr, File, AstNode,
@@ -84,7 +85,7 @@ impl AnalysisHostImpl {
84 data.root = Arc::new(data.root.apply_changes(&mut iter::empty(), Some(resolver))); 85 data.root = Arc::new(data.root.apply_changes(&mut iter::empty(), Some(resolver)));
85 } 86 }
86 pub fn set_crate_graph(&mut self, graph: CrateGraph) { 87 pub fn set_crate_graph(&mut self, graph: CrateGraph) {
87 let mut visited = HashSet::new(); 88 let mut visited = FxHashSet::default();
88 for &file_id in graph.crate_roots.values() { 89 for &file_id in graph.crate_roots.values() {
89 if !visited.insert(file_id) { 90 if !visited.insert(file_id) {
90 panic!("duplicate crate root: {:?}", file_id); 91 panic!("duplicate crate root: {:?}", file_id);
@@ -168,7 +169,7 @@ impl AnalysisImpl {
168 let mut res = Vec::new(); 169 let mut res = Vec::new();
169 let mut work = VecDeque::new(); 170 let mut work = VecDeque::new();
170 work.push_back(file_id); 171 work.push_back(file_id);
171 let mut visited = HashSet::new(); 172 let mut visited = FxHashSet::default();
172 while let Some(id) = work.pop_front() { 173 while let Some(id) = work.pop_front() {
173 if let Some(crate_id) = crate_graph.crate_id_for_crate_root(id) { 174 if let Some(crate_id) = crate_graph.crate_id_for_crate_root(id) {
174 res.push(crate_id); 175 res.push(crate_id);