use anyhow; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use settings::Setting; #[derive(Clone, Debug, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] pub enum AssistantDockPosition { Left, Right, Bottom, } #[derive(Deserialize, Debug)] pub struct AssistantSettings { pub dock: AssistantDockPosition, pub default_width: f32, pub default_height: f32, } #[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)] pub struct AssistantSettingsContent { pub dock: Option, pub default_width: Option, pub default_height: Option, } impl Setting for AssistantSettings { const KEY: Option<&'static str> = Some("assistant"); type FileContent = AssistantSettingsContent; fn load( default_value: &Self::FileContent, user_values: &[&Self::FileContent], _: &gpui::AppContext, ) -> anyhow::Result { Self::load_via_json_merge(default_value, user_values) } }