Merge pull request #20020 from Veykril/push-yuqmorzsqumw

fix: Reload workspaces when cargo configs change
This commit is contained in:
Lukas Wirth 2025-06-17 09:24:13 +00:00 committed by GitHub
commit 2b0c726e1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 11 deletions

View file

@ -239,7 +239,7 @@ pub(crate) fn handle_did_change_configuration(
let (config, e, _) = config.apply_change(change);
this.config_errors = e.is_empty().not().then_some(e);
// Client config changes neccesitates .update_config method to be called.
// Client config changes necessitates .update_config method to be called.
this.update_configuration(config);
}
}

View file

@ -114,6 +114,16 @@ impl GlobalState {
Durability::HIGH,
);
}
if self.config.cargo(None) != old_config.cargo(None) {
let req = FetchWorkspaceRequest { path: None, force_crate_graph_reload: false };
self.fetch_workspaces_queue.request_op("cargo config changed".to_owned(), req)
}
if self.config.cfg_set_test(None) != old_config.cfg_set_test(None) {
let req = FetchWorkspaceRequest { path: None, force_crate_graph_reload: false };
self.fetch_workspaces_queue.request_op("cfg_set_test config changed".to_owned(), req)
}
}
pub(crate) fn current_status(&self) -> lsp_ext::ServerStatusParams {