Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ea71a49

Browse files
committed
Auto merge of rust-lang#15577 - Veykril:clear-native-diags, r=Veykril
Clear native diagnostics on file closing Fixes rust-lang/rust-analyzer#15562
2 parents 70a6cf0 + 297ed70 commit ea71a49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/rust-analyzer/src/handlers/notification.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ pub(crate) fn handle_did_close_text_document(
113113
tracing::error!("orphan DidCloseTextDocument: {}", path);
114114
}
115115

116+
if let Some(file_id) = state.vfs.read().0.file_id(&path) {
117+
state.diagnostics.clear_native_for(file_id);
118+
}
119+
116120
state.semantic_tokens_cache.lock().remove(&params.text_document.uri);
117121

118122
if let Some(path) = path.as_path() {

0 commit comments

Comments
 (0)