mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Introduce ModuleId
Previously, module was synonym with a file, and so a module could have had several parents. This commit introduces a separate module concept, such that each module has only one parent, but a single file can correspond to different modules.
This commit is contained in:
parent
1d574ed654
commit
dc477db757
10 changed files with 493 additions and 443 deletions
|
@ -34,7 +34,7 @@ impl Hash for SymbolIndex {
|
|||
}
|
||||
|
||||
impl SymbolIndex {
|
||||
pub(crate) fn for_files(files: impl ParallelIterator<Item = (FileId, File)>) -> SymbolIndex {
|
||||
pub(crate) fn for_files(files: impl Iterator<Item = (FileId, File)>) -> SymbolIndex {
|
||||
let mut symbols = files
|
||||
.flat_map(|(file_id, file)| {
|
||||
file_symbols(&file)
|
||||
|
@ -52,7 +52,7 @@ impl SymbolIndex {
|
|||
}
|
||||
|
||||
pub(crate) fn for_file(file_id: FileId, file: File) -> SymbolIndex {
|
||||
SymbolIndex::for_files(::rayon::iter::once((file_id, file)))
|
||||
SymbolIndex::for_files(::std::iter::once((file_id, file)))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue