slash_command_settings.rs

 1use gpui::App;
 2use settings::Settings;
 3
 4/// Settings for slash commands.
 5#[derive(Debug, Default, Clone)]
 6pub struct SlashCommandSettings {
 7    /// Settings for the `/cargo-workspace` slash command.
 8    pub cargo_workspace: CargoWorkspaceCommandSettings,
 9}
10
11/// Settings for the `/cargo-workspace` slash command.
12#[derive(Debug, Default, Clone)]
13pub struct CargoWorkspaceCommandSettings {
14    /// Whether `/cargo-workspace` is enabled.
15    pub enabled: bool,
16}
17
18// todo!() I think this setting is bogus... default.json has "slash_commands": {"project"}
19impl Settings for SlashCommandSettings {
20    fn from_defaults(_content: &settings::SettingsContent, _cx: &mut App) -> Self {
21        Self {
22            cargo_workspace: CargoWorkspaceCommandSettings { enabled: false },
23        }
24    }
25
26    fn refine(&mut self, _content: &settings::SettingsContent, _cx: &mut App) {}
27}