Start work on creating the inital structure for the settings UI

We created a proc macro that derives the settings ui trait on types and
added that trait as a marker on Settings trait. Then we added the derive
macro on all settings

Co-authored-by: Ben Kunkle <ben@zed.dev>
This commit is contained in:
Anthony 2025-08-25 15:42:15 -04:00
parent 5fd29d37a6
commit 3c0ec5f612
43 changed files with 170 additions and 82 deletions

View file

@ -17,7 +17,7 @@ use gpui::{
use project::{Project, ProjectEntryId, ProjectPath};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsLocation, SettingsSources};
use settings::{DeriveSettingsUI as SettingsUI, Settings, SettingsLocation, SettingsSources};
use smallvec::SmallVec;
use std::{
any::{Any, TypeId},
@ -49,7 +49,7 @@ impl Default for SaveOptions {
}
}
#[derive(Deserialize)]
#[derive(Deserialize, SettingsUI)]
pub struct ItemSettings {
pub git_status: bool,
pub close_position: ClosePosition,
@ -59,7 +59,7 @@ pub struct ItemSettings {
pub show_close_button: ShowCloseButton,
}
#[derive(Deserialize)]
#[derive(Deserialize, SettingsUI)]
pub struct PreviewTabsSettings {
pub enabled: bool,
pub enable_preview_from_file_finder: bool,

View file

@ -6,9 +6,9 @@ use collections::HashMap;
use gpui::App;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsSources};
use settings::{DeriveSettingsUI as SettingsUI, Settings, SettingsSources};
#[derive(Deserialize)]
#[derive(Deserialize, SettingsUI)]
pub struct WorkspaceSettings {
pub active_pane_modifiers: ActivePanelModifiers,
pub bottom_dock_layout: BottomDockLayout,
@ -204,7 +204,7 @@ pub struct WorkspaceSettingsContent {
pub close_on_file_delete: Option<bool>,
}
#[derive(Deserialize)]
#[derive(Deserialize, SettingsUI)]
pub struct TabBarSettings {
pub show: bool,
pub show_nav_history_buttons: bool,