Skip to content

Commit a4d669b

Browse files
committed
Refresh diagnostics if config changed
1 parent b9465f1 commit a4d669b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/ark/src/lsp/state_handlers.rs

Lines changed: 9 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

@@ -349,6 +352,12 @@ async fn update_config(
349352
}
350353
}
351354

355+
// Refresh diagnostics if the configuration changed
356+
if state.config.diagnostics != diagnostics_config {
357+
tracing::info!("Refreshing diagnostics after configuration changed");
358+
lsp::spawn_diagnostics_refresh_all(state.clone());
359+
}
360+
352361
Ok(())
353362
}
354363

0 commit comments

Comments
 (0)