mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 18:46:49 +00:00
e4b1c76895
Let this screenshot of settings.json speak for itself: ![image](https://github.com/zed-industries/zed/assets/24362066/fca60383-1788-43f9-803b-00f083394c8a) Release Notes: - Added code completion & on-hover documentation to Zed's settings.json file. --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
79 lines
2.2 KiB
Rust
79 lines
2.2 KiB
Rust
use anyhow;
|
|
use gpui::Pixels;
|
|
use schemars::JsonSchema;
|
|
use serde_derive::{Deserialize, Serialize};
|
|
use settings::Settings;
|
|
use workspace::dock::DockPosition;
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
pub struct CollaborationPanelSettings {
|
|
pub button: bool,
|
|
pub dock: DockPosition,
|
|
pub default_width: Pixels,
|
|
}
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
pub struct ChatPanelSettings {
|
|
pub button: bool,
|
|
pub dock: DockPosition,
|
|
pub default_width: Pixels,
|
|
}
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
pub struct NotificationPanelSettings {
|
|
pub button: bool,
|
|
pub dock: DockPosition,
|
|
pub default_width: Pixels,
|
|
}
|
|
|
|
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
|
|
pub struct PanelSettingsContent {
|
|
/// Whether to show the panel button in the status bar.
|
|
///
|
|
/// Default: true
|
|
pub button: Option<bool>,
|
|
/// Where to dock the panel.
|
|
///
|
|
/// Default: left
|
|
pub dock: Option<DockPosition>,
|
|
/// Default width of the panel in pixels.
|
|
///
|
|
/// Default: 240
|
|
pub default_width: Option<f32>,
|
|
}
|
|
|
|
impl Settings for CollaborationPanelSettings {
|
|
const KEY: Option<&'static str> = Some("collaboration_panel");
|
|
type FileContent = PanelSettingsContent;
|
|
fn load(
|
|
default_value: &Self::FileContent,
|
|
user_values: &[&Self::FileContent],
|
|
_: &mut gpui::AppContext,
|
|
) -> anyhow::Result<Self> {
|
|
Self::load_via_json_merge(default_value, user_values)
|
|
}
|
|
}
|
|
|
|
impl Settings for ChatPanelSettings {
|
|
const KEY: Option<&'static str> = Some("chat_panel");
|
|
type FileContent = PanelSettingsContent;
|
|
fn load(
|
|
default_value: &Self::FileContent,
|
|
user_values: &[&Self::FileContent],
|
|
_: &mut gpui::AppContext,
|
|
) -> anyhow::Result<Self> {
|
|
Self::load_via_json_merge(default_value, user_values)
|
|
}
|
|
}
|
|
|
|
impl Settings for NotificationPanelSettings {
|
|
const KEY: Option<&'static str> = Some("notification_panel");
|
|
type FileContent = PanelSettingsContent;
|
|
fn load(
|
|
default_value: &Self::FileContent,
|
|
user_values: &[&Self::FileContent],
|
|
_: &mut gpui::AppContext,
|
|
) -> anyhow::Result<Self> {
|
|
Self::load_via_json_merge(default_value, user_values)
|
|
}
|
|
}
|