Make remote projects to sync in local user settings (#37560)
Closes https://github.com/zed-industries/zed/issues/20024 Closes https://github.com/zed-industries/zed/issues/23489 https://github.com/user-attachments/assets/6466e0c1-4188-4980-8bb6-52ef6e7591c9 Release Notes: - Made remote projects to sync in local user settings
This commit is contained in:
@@ -467,6 +467,13 @@ impl SettingsStore {
|
||||
&self.raw_user_settings
|
||||
}
|
||||
|
||||
/// Replaces current settings with the values from the given JSON.
|
||||
pub fn set_raw_user_settings(&mut self, new_settings: Value, cx: &mut App) -> Result<()> {
|
||||
self.raw_user_settings = new_settings;
|
||||
self.recompute_values(None, cx)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get the configured settings profile names.
|
||||
pub fn configured_settings_profiles(&self) -> impl Iterator<Item = &str> {
|
||||
self.raw_user_settings
|
||||
@@ -525,20 +532,6 @@ impl SettingsStore {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn load_global_settings(fs: &Arc<dyn Fs>) -> Result<String> {
|
||||
match fs.load(paths::global_settings_file()).await {
|
||||
result @ Ok(_) => result,
|
||||
Err(err) => {
|
||||
if let Some(e) = err.downcast_ref::<std::io::Error>()
|
||||
&& e.kind() == std::io::ErrorKind::NotFound
|
||||
{
|
||||
return Ok("{}".to_string());
|
||||
}
|
||||
Err(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn update_settings_file_inner(
|
||||
&self,
|
||||
fs: Arc<dyn Fs>,
|
||||
|
||||
Reference in New Issue
Block a user