Add initial project panel settings
This commit is contained in:
parent
54c04a6618
commit
7be8dead07
5 changed files with 49 additions and 1 deletions
29
crates/project_panel/src/project_panel_settings.rs
Normal file
29
crates/project_panel/src/project_panel_settings.rs
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue