We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f02c915 commit 5410aceCopy full SHA for 5410ace
crates/rust-analyzer/src/diagnostics.rs
@@ -40,6 +40,11 @@ impl DiagnosticCollection {
40
self.changes.extend(self.check.drain().map(|(key, _value)| key))
41
}
42
43
+ pub(crate) fn clear_native_for(&mut self, file_id: FileId) {
44
+ self.native.remove(&file_id);
45
+ self.changes.insert(file_id);
46
+ }
47
+
48
pub(crate) fn add_check_diagnostic(
49
&mut self,
50
file_id: FileId,
crates/rust-analyzer/src/global_state.rs
@@ -201,6 +201,10 @@ impl GlobalState {
201
202
203
204
+ if !file.exists() {
205
+ self.diagnostics.clear_native_for(file.file_id);
206
207
208
let text = if file.exists() {
209
let bytes = vfs.file_contents(file.file_id).to_vec();
210
String::from_utf8(bytes).ok().and_then(|text| {
0 commit comments