diff --git a/CHANGELOG.md b/CHANGELOG.md index d859724e..afdaa917 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `texlab.inlayHints.labelDefinitions` and `texlab.inlayHints.labelReferences` options ([#753](https://github.com/latex-lsp/texlab/issues/753)) - Display inlay hints for label references by default ([#753](https://github.com/latex-lsp/texlab/issues/753)) +### Fixed + +- Moving the build logs to the recycle bin will now clear the diagnostics ([texlab-vscode/#825](https://github.com/latex-lsp/texlab-vscode/issues/825)) + ## [5.10.1] - 2023-10-10 ### Fixed diff --git a/crates/texlab/src/server.rs b/crates/texlab/src/server.rs index 5a0c4896..7757bbb4 100644 --- a/crates/texlab/src/server.rs +++ b/crates/texlab/src/server.rs @@ -18,6 +18,7 @@ use diagnostics::{DiagnosticManager, DiagnosticSource}; use distro::{Distro, Language}; use lsp_server::{Connection, ErrorCode, Message, RequestId}; use lsp_types::{notification::*, request::*, *}; +use notify::event::ModifyKind; use notify_debouncer_full::{DebouncedEvent, Debouncer, FileIdMap}; use parking_lot::{Mutex, RwLock}; use rowan::ast::AstNode; @@ -878,6 +879,17 @@ impl Server { let mut workspace = self.workspace.write(); match event.kind { + notify::EventKind::Remove(_) | notify::EventKind::Modify(ModifyKind::Name(_)) => { + for path in event.paths { + if let Some(document) = workspace.lookup_path(&path) { + if document.owner == Owner::Server { + let uri = document.uri.clone(); + workspace.remove(&uri); + changed = true; + } + } + } + } notify::EventKind::Create(_) | notify::EventKind::Modify(_) => { for path in event.paths { if workspace @@ -894,17 +906,6 @@ impl Server { } } } - notify::EventKind::Remove(_) => { - for path in event.paths { - if let Some(document) = workspace.lookup_path(&path) { - if document.owner == Owner::Server { - let uri = document.uri.clone(); - workspace.remove(&uri); - changed = true; - } - } - } - } notify::EventKind::Any | notify::EventKind::Access(_) | notify::EventKind::Other => {} };