fix: Fix formatting requests hanging when r-a is still starting

The reason for that was that we were calculating the crate defmaps
of the file we are saving by accident causing us to get stuck waiting
on their expensive computation, while we only need the relevant crate
id.
This commit is contained in:
Lukas Wirth 2022-10-17 17:53:50 +02:00
parent 40cbeb5b3d
commit a762baca02
8 changed files with 17 additions and 24 deletions

View file

@ -482,8 +482,8 @@ impl Analysis {
}
/// Returns crates this file belongs too.
pub fn crate_for(&self, file_id: FileId) -> Cancellable<Vec<CrateId>> {
self.with_db(|db| parent_module::crate_for(db, file_id))
pub fn crates_for(&self, file_id: FileId) -> Cancellable<Vec<CrateId>> {
self.with_db(|db| parent_module::crates_for(db, file_id))
}
/// Returns the edition of the given crate.