diff options
| author | bors <bors@rust-lang.org> | 2023-09-08 11:54:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-09-08 11:54:59 +0000 |
| commit | ea71a49c8ec33a1c14359e1972f1280297c2bbb6 (patch) | |
| tree | 82dc1cbbc1d15c9d2186c549ca14957c91bbde84 | |
| parent | 70a6cf0ef720b4a8e475735f5fc794cf56d290e5 (diff) | |
| parent | 297ed70a238aca12db010046934cbd3d60b6dc84 (diff) | |
| download | rust-ea71a49c8ec33a1c14359e1972f1280297c2bbb6.tar.gz rust-ea71a49c8ec33a1c14359e1972f1280297c2bbb6.zip | |
Auto merge of #15577 - Veykril:clear-native-diags, r=Veykril
Clear native diagnostics on file closing Fixes https://github.com/rust-lang/rust-analyzer/issues/15562
| -rw-r--r-- | crates/rust-analyzer/src/handlers/notification.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/handlers/notification.rs b/crates/rust-analyzer/src/handlers/notification.rs index 93f33d7cac9..f9070d27353 100644 --- a/crates/rust-analyzer/src/handlers/notification.rs +++ b/crates/rust-analyzer/src/handlers/notification.rs @@ -113,6 +113,10 @@ pub(crate) fn handle_did_close_text_document( tracing::error!("orphan DidCloseTextDocument: {}", path); } + if let Some(file_id) = state.vfs.read().0.file_id(&path) { + state.diagnostics.clear_native_for(file_id); + } + state.semantic_tokens_cache.lock().remove(¶ms.text_document.uri); if let Some(path) = path.as_path() { |
