diff options
author | Aleksey Kladov <[email protected]> | 2020-06-11 10:04:09 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-23 16:51:06 +0100 |
commit | dad1333b48c38bc7a5628fc0ff5304d003776a85 (patch) | |
tree | 29be52a980b4cae72f46a48c48135a15e31641e0 /crates/ra_ide_db/src/symbol_index.rs | |
parent | 7aa66371ee3e8b31217513204c8b4f683584419d (diff) |
New VFS
Diffstat (limited to 'crates/ra_ide_db/src/symbol_index.rs')
-rw-r--r-- | crates/ra_ide_db/src/symbol_index.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs index 25c99813f..6929055b2 100644 --- a/crates/ra_ide_db/src/symbol_index.rs +++ b/crates/ra_ide_db/src/symbol_index.rs | |||
@@ -42,7 +42,7 @@ use ra_syntax::{ | |||
42 | SyntaxNode, SyntaxNodePtr, TextRange, WalkEvent, | 42 | SyntaxNode, SyntaxNodePtr, TextRange, WalkEvent, |
43 | }; | 43 | }; |
44 | use rayon::prelude::*; | 44 | use rayon::prelude::*; |
45 | use rustc_hash::FxHashMap; | 45 | use rustc_hash::{FxHashMap, FxHashSet}; |
46 | 46 | ||
47 | use crate::RootDatabase; | 47 | use crate::RootDatabase; |
48 | 48 | ||
@@ -93,11 +93,11 @@ pub trait SymbolsDatabase: hir::db::HirDatabase + SourceDatabaseExt + ParallelDa | |||
93 | /// The set of "local" (that is, from the current workspace) roots. | 93 | /// The set of "local" (that is, from the current workspace) roots. |
94 | /// Files in local roots are assumed to change frequently. | 94 | /// Files in local roots are assumed to change frequently. |
95 | #[salsa::input] | 95 | #[salsa::input] |
96 | fn local_roots(&self) -> Arc<Vec<SourceRootId>>; | 96 | fn local_roots(&self) -> Arc<FxHashSet<SourceRootId>>; |
97 | /// The set of roots for crates.io libraries. | 97 | /// The set of roots for crates.io libraries. |
98 | /// Files in libraries are assumed to never change. | 98 | /// Files in libraries are assumed to never change. |
99 | #[salsa::input] | 99 | #[salsa::input] |
100 | fn library_roots(&self) -> Arc<Vec<SourceRootId>>; | 100 | fn library_roots(&self) -> Arc<FxHashSet<SourceRootId>>; |
101 | } | 101 | } |
102 | 102 | ||
103 | fn library_symbols( | 103 | fn library_symbols( |
@@ -111,7 +111,7 @@ fn library_symbols( | |||
111 | .map(|&root_id| { | 111 | .map(|&root_id| { |
112 | let root = db.source_root(root_id); | 112 | let root = db.source_root(root_id); |
113 | let files = root | 113 | let files = root |
114 | .walk() | 114 | .iter() |
115 | .map(|it| (it, SourceDatabaseExt::file_text(db, it))) | 115 | .map(|it| (it, SourceDatabaseExt::file_text(db, it))) |
116 | .collect::<Vec<_>>(); | 116 | .collect::<Vec<_>>(); |
117 | let symbol_index = SymbolIndex::for_files( | 117 | let symbol_index = SymbolIndex::for_files( |
@@ -175,7 +175,7 @@ pub fn world_symbols(db: &RootDatabase, query: Query) -> Vec<FileSymbol> { | |||
175 | let mut files = Vec::new(); | 175 | let mut files = Vec::new(); |
176 | for &root in db.local_roots().iter() { | 176 | for &root in db.local_roots().iter() { |
177 | let sr = db.source_root(root); | 177 | let sr = db.source_root(root); |
178 | files.extend(sr.walk()) | 178 | files.extend(sr.iter()) |
179 | } | 179 | } |
180 | 180 | ||
181 | let snap = Snap(db.snapshot()); | 181 | let snap = Snap(db.snapshot()); |