Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-ssr/src/search.rs')
-rw-r--r--crates/ide-ssr/src/search.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/ide-ssr/src/search.rs b/crates/ide-ssr/src/search.rs
index 72f857ceda..5f54c66d3c 100644
--- a/crates/ide-ssr/src/search.rs
+++ b/crates/ide-ssr/src/search.rs
@@ -6,9 +6,10 @@ use crate::{
};
use hir::FileRange;
use ide_db::{
- EditionedFileId, FileId, FxHashSet,
+ FileId, FxHashSet,
defs::Definition,
search::{SearchScope, UsageSearchResult},
+ symbol_index::LocalRoots,
};
use syntax::{AstNode, SyntaxKind, SyntaxNode, ast};
@@ -135,11 +136,7 @@ impl<'db> MatchFinder<'db> {
// seems to get put into a single source root.
let mut files = Vec::new();
self.search_files_do(|file_id| {
- files.push(
- self.sema
- .attach_first_edition(file_id)
- .unwrap_or_else(|| EditionedFileId::current_edition(self.sema.db, file_id)),
- );
+ files.push(self.sema.attach_first_edition(file_id));
});
SearchScope::files(&files)
}
@@ -156,8 +153,7 @@ impl<'db> MatchFinder<'db> {
if self.restrict_ranges.is_empty() {
// Unrestricted search.
use ide_db::base_db::SourceDatabase;
- use ide_db::symbol_index::SymbolsDatabase;
- for &root in self.sema.db.local_roots().iter() {
+ for &root in LocalRoots::get(self.sema.db).roots(self.sema.db).iter() {
let sr = self.sema.db.source_root(root).source_root(self.sema.db);
for file_id in sr.iter() {
callback(file_id);