Settings refactor (#38367)

Co-Authored-By: Ben K <ben@zed.dev>
Co-Authored-By: Anthony <anthony@zed.dev>
Co-Authored-By: Mikayla <mikayla@zed.dev>

Release Notes:

- settings: Major internal changes to settings. The primary user-facing
effect is that some settings which did not make sense in project
settings files are no-longer read from there. (For example the inline
blame settings)

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
Conrad Irwin
2025-09-18 16:47:23 +00:00
committed by GitHub
co-authored by Ben Kunkle Mikayla Maki Anthony
parent 0a9023bce0
commit fcdab160f9
219 changed files with 11697 additions and 11894 deletions
+4 -18
View File
@@ -12,7 +12,6 @@ use crate::{
use anyhow::{Context as _, Result, anyhow};
use collections::IndexMap;
use dap::adapters::DebugAdapterName;
use dap::debugger_settings::DebugPanelDockPosition;
use dap::{DapRegistry, StartDebuggingRequestArguments};
use dap::{client::SessionId, debugger_settings::DebuggerSettings};
use editor::Editor;
@@ -1400,11 +1399,7 @@ impl Panel for DebugPanel {
}
fn position(&self, _window: &Window, cx: &App) -> DockPosition {
match DebuggerSettings::get_global(cx).dock {
DebugPanelDockPosition::Left => DockPosition::Left,
DebugPanelDockPosition::Bottom => DockPosition::Bottom,
DebugPanelDockPosition::Right => DockPosition::Right,
}
DebuggerSettings::get_global(cx).dock.into()
}
fn position_is_valid(&self, _: DockPosition) -> bool {
@@ -1426,18 +1421,9 @@ impl Panel for DebugPanel {
});
}
settings::update_settings_file::<DebuggerSettings>(
self.fs.clone(),
cx,
move |settings, _| {
let dock = match position {
DockPosition::Left => DebugPanelDockPosition::Left,
DockPosition::Bottom => DebugPanelDockPosition::Bottom,
DockPosition::Right => DebugPanelDockPosition::Right,
};
settings.dock = dock;
},
);
settings::update_settings_file(self.fs.clone(), cx, move |settings, _| {
settings.debugger.get_or_insert_default().dock = Some(position.into());
});
}
fn size(&self, _window: &Window, _: &App) -> Pixels {