Skip to content

Commit 1c4fa66

Browse files
committed
Refresh diagnostics if config changed
1 parent e119f0a commit 1c4fa66

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/ark/src/lsp/state_handlers.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ async fn update_config(
283283
client: &tower_lsp::Client,
284284
state: &mut WorldState,
285285
) -> anyhow::Result<()> {
286+
// Keep track of existing config to detect whether it was changed
287+
let diagnostics_config = state.config.diagnostics.clone();
288+
286289
// Build the configuration request for global and document settings
287290
let mut items: Vec<_> = vec![];
288291

@@ -346,6 +349,11 @@ async fn update_config(
346349
}
347350
}
348351

352+
// Refresh diagnostics if the configuration changed
353+
if state.config.diagnostics != diagnostics_config {
354+
lsp::spawn_diagnostics_refresh_all(state.clone());
355+
}
356+
349357
Ok(())
350358
}
351359

0 commit comments

Comments
 (0)