Skip to content

Commit

Permalink
LS: Schedule only module main files for diagnostics refreshing (stark…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaput authored Oct 30, 2024
1 parent cc5bd37 commit e3f140a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ pub fn refresh_diagnostics(
let mut rest_of_files: HashSet<FileId> = HashSet::default();
for crate_id in db.crates() {
for module_id in db.crate_modules(crate_id).iter() {
if let Ok(module_files) = db.module_files(*module_id) {
let unprocessed_files =
module_files.iter().filter(|file| !open_files_ids.contains(file));
rest_of_files.extend(unprocessed_files);
// Schedule only module main files for refreshing.
// All other related files will be refreshed along with it in a single job.
if let Ok(file) = db.module_main_file(*module_id) {
if !open_files_ids.contains(&file) {
rest_of_files.insert(file);
}
}
}
}
Expand Down

0 comments on commit e3f140a

Please sign in to comment.