aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorPascal Kuthe2023-03-12 00:00:24 +0000
committerBlaž Hrastnik2023-03-16 06:45:49 +0000
commit3c9d5d02153ca2d81e2780e1f6daeefc40de2706 (patch)
tree5f5d2c8b9dcb61ff2058f2b6cf6e47e46fdaae82 /helix-term/src
parent2a27d1b505a676c436a4b4d37d7124f9bc098225 (diff)
discard outdated diagnostics recived by the LS
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/application.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 14636829..8803792a 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -709,7 +709,16 @@ impl Application {
return;
}
};
- let doc = self.editor.document_by_path_mut(&path);
+ let doc = self.editor.document_by_path_mut(&path).filter(|doc| {
+ if let Some(version) = params.version {
+ if version != doc.version() {
+ log::info!("Version ({version}) is out of date for {path:?} (expected ({}), dropping PublishDiagnostic notification", doc.version());
+ return false;
+ }
+ }
+
+ true
+ });
if let Some(doc) = doc {
let lang_conf = doc.language_config();