Skip to content

Commit 84f5ee7

Browse files
committed
Refresh all diagnostics when a single file is updated
1 parent 51cb878 commit 84f5ee7

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

crates/ark/src/lsp/main_loop.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -869,21 +869,12 @@ pub(crate) fn index_update(uri: Url, document: Document, state: WorldState) {
869869
}))
870870
.unwrap_or_else(|err| lsp::log_error!("Failed to queue index update: {err}"));
871871

872-
diagnostics_refresh(uri, state.clone());
873-
}
874-
875-
pub(crate) fn diagnostics_refresh(uri: Url, state: WorldState) {
876-
INDEXER_QUEUE
877-
.send(IndexerQueueTask::Diagnostics(RefreshDiagnosticsTask {
878-
uri,
879-
state,
880-
}))
881-
.unwrap_or_else(|err| lsp::log_error!("Failed to queue diagnostics refresh: {err}"));
872+
// Refresh all diagnostics since the indexer results for one file may affect
873+
// other files
874+
diagnostics_refresh_all(state);
882875
}
883876

884877
pub(crate) fn diagnostics_refresh_all(state: WorldState) {
885-
// Expand RefreshAll into individual RefreshDiagnostics tasks
886-
// This allows the deduplication logic to work uniformly
887878
for (uri, _document) in state.documents.iter() {
888879
INDEXER_QUEUE
889880
.send(IndexerQueueTask::Diagnostics(RefreshDiagnosticsTask {

0 commit comments

Comments
 (0)