use super::*;
pub(crate) fn ensure_settings_schema_files(paths: &McPaths) -> anyhow::Result<()> {
ensure_settings_schema_files_and_load(paths).map(|_| ())
}
pub(crate) fn load_config_with_settings(
paths: McPaths,
cli: CliConfigOverrides,
) -> anyhow::Result<(
EffectiveConfig,
Settings,
AppearanceSettings,
SessionSettings,
)> {
let (document, session_settings) = read_settings_document_with_session_settings(&paths)?;
let config = EffectiveConfig::from_loaded_settings(paths, cli, document.settings.clone())?;
Ok((
config,
document.settings,
document.appearance,
session_settings,
))
}
pub(crate) fn write_settings(paths: &McPaths, settings: &Settings) -> anyhow::Result<()> {
validate_settings(settings)?;
update_settings_json(paths, SettingsScope::Global, |raw| {
let before: Settings = serde_json::from_value(raw.clone())?;
update_raw_from_settings(raw, &before, settings, SettingsScope::Global)
})?;
Ok(())
}