mirror of https://github.com/helix-editor/helix
discard outdated diagnostics recived by the LS
parent
2a27d1b505
commit
3c9d5d0215
|
@ -387,6 +387,7 @@ impl Client {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}),
|
}),
|
||||||
publish_diagnostics: Some(lsp::PublishDiagnosticsClientCapabilities {
|
publish_diagnostics: Some(lsp::PublishDiagnosticsClientCapabilities {
|
||||||
|
version_support: Some(true),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}),
|
}),
|
||||||
inlay_hint: Some(lsp::InlayHintClientCapabilities {
|
inlay_hint: Some(lsp::InlayHintClientCapabilities {
|
||||||
|
|
|
@ -709,7 +709,16 @@ impl Application {
|
||||||
return;
|
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 {
|
if let Some(doc) = doc {
|
||||||
let lang_conf = doc.language_config();
|
let lang_conf = doc.language_config();
|
||||||
|
|
Loading…
Reference in New Issue