Merge pull request #18432 from Veykril/lw-yptzmuxyvxxt
fix: Fix the server not honoring diagnostic refresh support
This commit is contained in:
commit
c21de28911
@ -463,6 +463,11 @@ pub fn inlay_hints_refresh(&self) -> bool {
|
|||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn diagnostics_refresh(&self) -> bool {
|
||||||
|
(|| -> _ { self.0.workspace.as_ref()?.diagnostic.as_ref()?.refresh_support })()
|
||||||
|
.unwrap_or_default()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn inlay_hint_resolve_support_properties(&self) -> FxHashSet<&str> {
|
pub fn inlay_hint_resolve_support_properties(&self) -> FxHashSet<&str> {
|
||||||
self.0
|
self.0
|
||||||
.text_document
|
.text_document
|
||||||
|
@ -417,8 +417,6 @@ fn handle_event(&mut self, event: Event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let supports_diagnostic_pull_model = self.config.text_document_diagnostic();
|
|
||||||
|
|
||||||
let client_refresh = became_quiescent || state_changed;
|
let client_refresh = became_quiescent || state_changed;
|
||||||
if client_refresh {
|
if client_refresh {
|
||||||
// Refresh semantic tokens if the client supports it.
|
// Refresh semantic tokens if the client supports it.
|
||||||
@ -437,7 +435,7 @@ fn handle_event(&mut self, event: Event) {
|
|||||||
self.send_request::<lsp_types::request::InlayHintRefreshRequest>((), |_, _| ());
|
self.send_request::<lsp_types::request::InlayHintRefreshRequest>((), |_, _| ());
|
||||||
}
|
}
|
||||||
|
|
||||||
if supports_diagnostic_pull_model {
|
if self.config.diagnostics_refresh() {
|
||||||
self.send_request::<lsp_types::request::WorkspaceDiagnosticRefresh>(
|
self.send_request::<lsp_types::request::WorkspaceDiagnosticRefresh>(
|
||||||
(),
|
(),
|
||||||
|_, _| (),
|
|_, _| (),
|
||||||
@ -448,7 +446,7 @@ fn handle_event(&mut self, event: Event) {
|
|||||||
let project_or_mem_docs_changed =
|
let project_or_mem_docs_changed =
|
||||||
became_quiescent || state_changed || memdocs_added_or_removed;
|
became_quiescent || state_changed || memdocs_added_or_removed;
|
||||||
if project_or_mem_docs_changed
|
if project_or_mem_docs_changed
|
||||||
&& !supports_diagnostic_pull_model
|
&& !self.config.text_document_diagnostic()
|
||||||
&& self.config.publish_diagnostics(None)
|
&& self.config.publish_diagnostics(None)
|
||||||
{
|
{
|
||||||
self.update_diagnostics();
|
self.update_diagnostics();
|
||||||
|
Loading…
Reference in New Issue
Block a user