Add initial project panel settings

This commit is contained in:
Mikayla Maki 2023-05-22 20:23:07 -07:00
parent 54c04a6618
commit 7be8dead07
No known key found for this signature in database
5 changed files with 49 additions and 1 deletions

View file

@ -0,0 +1,29 @@
use serde_derive::{Deserialize, Serialize};
use anyhow;
use settings::Setting;
use schemars::JsonSchema;
#[derive(Deserialize, Debug)]
pub struct ProjectPanelSettings {
pub git_status: bool,
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
pub struct ProjectPanelSettingsContent {
pub git_status: Option<bool>,
}
impl Setting for ProjectPanelSettings {
const KEY: Option<&'static str> = Some("project_panel");
type FileContent = ProjectPanelSettingsContent;
fn load(
default_value: &Self::FileContent,
user_values: &[&Self::FileContent],
_: &gpui::AppContext,
) -> anyhow::Result<Self> {
Self::load_via_json_merge(default_value, user_values)
}
}