mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
internal: Consider all kinds of explicit private imports in find_path
This commit is contained in:
parent
d5366b5c19
commit
b6e6d5d3af
15 changed files with 211 additions and 223 deletions
|
@ -7,7 +7,6 @@ mod change;
|
|||
|
||||
use std::panic;
|
||||
|
||||
use rustc_hash::FxHashSet;
|
||||
use syntax::{ast, Parse, SourceFile};
|
||||
use triomphe::Arc;
|
||||
|
||||
|
@ -90,15 +89,16 @@ pub trait SourceDatabaseExt: SourceDatabase {
|
|||
|
||||
fn source_root_crates(db: &dyn SourceDatabaseExt, id: SourceRootId) -> Arc<[CrateId]> {
|
||||
let graph = db.crate_graph();
|
||||
graph
|
||||
let mut crates = graph
|
||||
.iter()
|
||||
.filter(|&krate| {
|
||||
let root_file = graph[krate].root_file_id;
|
||||
db.file_source_root(root_file) == id
|
||||
})
|
||||
.collect::<FxHashSet<_>>()
|
||||
.into_iter()
|
||||
.collect()
|
||||
.collect::<Vec<_>>();
|
||||
crates.sort();
|
||||
crates.dedup();
|
||||
crates.into_iter().collect()
|
||||
}
|
||||
|
||||
/// Silly workaround for cyclic deps between the traits
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue