Auto merge of #12808 - Veykril:check-workspace, r=Veykril

feat: Only flycheck workspace that belongs to saved file

Supercedes https://github.com/rust-lang/rust-analyzer/pull/11038

There is still the problem that all the diagnostics are cleared, only clearing diagnostics of the relevant workspace isn't easily doable though I think, will have to dig into that
This commit is contained in:
bors 2022-08-04 12:57:04 +00:00
commit 0fe3bcfd35
7 changed files with 123 additions and 23 deletions

View file

@ -192,6 +192,7 @@ impl GlobalState {
if let Some(path) = vfs.file_path(file.file_id).as_path() {
let path = path.to_path_buf();
if reload::should_refresh_for_change(&path, file.change_kind) {
tracing::warn!("fetch-fiel_change");
self.fetch_workspaces_queue
.request_op(format!("vfs file change: {}", path.display()));
}
@ -201,6 +202,7 @@ impl GlobalState {
}
}
// Clear native diagnostics when their file gets deleted
if !file.exists() {
self.diagnostics.clear_native_for(file.file_id);
}