mirror of
https://github.com/VHDL-LS/rust_hdl.git
synced 2025-08-04 10:59:30 +00:00
Fix: Overwrite cached diagnostics to correctly update any subsequent diagnostics
This commit is contained in:
parent
8917ae3ca1
commit
5c79bc8715
1 changed files with 3 additions and 1 deletions
|
@ -26,7 +26,7 @@ impl VHDLServer {
|
|||
|
||||
let mut by_uri = diagnostics_by_uri(diagnostics);
|
||||
for (file_uri, cached_diagnostics) in self.diagnostic_cache.iter_mut() {
|
||||
let Some(new_diagnostics) = by_uri.remove(file_uri) else {
|
||||
let Some(mut new_diagnostics) = by_uri.remove(file_uri) else {
|
||||
// Diagnostics are in the cache, but not in the newly created diagnostics.
|
||||
// This means that there are no longer any diagnostics in the given file.
|
||||
// As a consequence, the client needs to be updated
|
||||
|
@ -54,6 +54,8 @@ impl VHDLServer {
|
|||
};
|
||||
self.rpc
|
||||
.send_notification("textDocument/publishDiagnostics", publish_diagnostics);
|
||||
cached_diagnostics.clear();
|
||||
cached_diagnostics.append(&mut new_diagnostics);
|
||||
}
|
||||
// else: diagnostics are the same in the cache and the new analysis state.
|
||||
// No need to update.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue