This commit is contained in:
Takayuki Maeda 2025-12-16 16:39:34 -05:00 committed by GitHub
commit 5c4d1c02a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,5 @@
use crate::{
Session,
lint::DiagnosticsMap,
session::{Client, DocumentQuery, DocumentSnapshot},
};
@ -38,9 +39,13 @@ pub(super) fn publish_diagnostics_for_document(
}
pub(super) fn clear_diagnostics_for_document(
session: &Session,
query: &DocumentQuery,
client: &Client,
) -> crate::server::Result<()> {
if session.resolved_client_capabilities().pull_diagnostics {
return Ok(());
}
client
.send_notification::<lsp_types::notification::PublishDiagnostics>(
lsp_types::PublishDiagnosticsParams {

View File

@ -27,7 +27,7 @@ impl super::SyncNotificationHandler for DidClose {
);
return Ok(());
};
clear_diagnostics_for_document(snapshot.query(), client)?;
clear_diagnostics_for_document(session, snapshot.query(), client)?;
session
.close_document(&key)