@@ -3,11 +3,11 @@ use std::sync::Arc;
use ui::{IntoElement, SharedString};
use crate::{
- SettingField, SettingItem, SettingsFieldMetadata, SettingsPage, SettingsPageItem, SubPageLink,
- sub_page_stack,
+ LOCAL, SettingField, SettingItem, SettingsFieldMetadata, SettingsPage, SettingsPageItem,
+ SubPageLink, USER, sub_page_stack,
};
-pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
+pub(crate) fn settings_data() -> Vec<SettingsPage> {
vec![
SettingsPage {
title: "General",
@@ -21,6 +21,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.workspace.confirm_quit,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Restore On Startup",
@@ -32,6 +33,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Restore File State",
@@ -43,6 +45,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Close on File Delete",
@@ -54,6 +57,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "When Closing With No Tabs",
@@ -67,6 +71,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "On Last Window Closed",
@@ -78,6 +83,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Use System Path Prompts",
@@ -91,6 +97,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Use System Prompts",
@@ -102,9 +109,11 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
// SettingsPageItem::SectionHeader("Scoped Settings"),
// todo(settings_ui): Implement another setting item type that just shows an edit in settings.json
+ // files: USER,
// SettingsPageItem::SettingItem(SettingItem {
// title: "Preview Channel",
// description: "Which settings should be activated only in Preview build of Zed",
@@ -116,6 +125,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
// }),
// metadata: None,
// }),
+ // files: USER,
// SettingsPageItem::SettingItem(SettingItem {
// title: "Settings Profiles",
// description: "Any number of settings profiles that are temporarily applied on top of your existing user settings.",
@@ -147,6 +157,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Telemetry Metrics",
@@ -164,6 +175,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
],
},
@@ -172,6 +184,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
items: vec![
// SettingsPageItem::SectionHeader("Theme"),
// todo(settings_ui): Figure out how we want to add these
+ // files: USER,
// SettingsPageItem::SettingItem(SettingItem {
// title: "Theme Mode",
// description: "How to select the theme",
@@ -181,6 +194,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
// }),
// metadata: None,
// }),
+ // files: USER,
// SettingsPageItem::SettingItem(SettingItem {
// title: "Icon Theme",
// // todo(settings_ui)
@@ -201,6 +215,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.theme.buffer_font_family,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Buffer Font Size",
@@ -210,6 +225,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.theme.buffer_font_size,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Buffer Font Weight",
@@ -219,8 +235,10 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.theme.buffer_font_weight,
}),
metadata: None,
+ files: USER,
}),
// todo(settings_ui): This needs custom ui
+ // files: USER,
// SettingsPageItem::SettingItem(SettingItem {
// title: "Buffer Line Height",
// description: "Line height for editor text",
@@ -238,6 +256,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.theme.ui_font_family,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "UI Font Size",
@@ -247,6 +266,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.theme.ui_font_size,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "UI Font Weight",
@@ -256,6 +276,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.theme.ui_font_weight,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SectionHeader("Keymap"),
SettingsPageItem::SettingItem(SettingItem {
@@ -266,6 +287,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.base_keymap,
}),
metadata: None,
+ files: USER,
}),
// todo(settings_ui): Vim/Helix Mode should be apart of one type because it's undefined
// behavior to have them both enabled at the same time
@@ -277,6 +299,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.vim_mode,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Helix Mode",
@@ -286,6 +309,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.helix_mode,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Multi Cursor Modifier",
@@ -297,6 +321,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SectionHeader("Cursor"),
SettingsPageItem::SettingItem(SettingItem {
@@ -307,6 +332,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.editor.cursor_blink,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Cursor Shape",
@@ -316,6 +342,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.editor.cursor_shape,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Hide Mouse",
@@ -325,6 +352,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.editor.hide_mouse,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SectionHeader("Highlighting"),
SettingsPageItem::SettingItem(SettingItem {
@@ -337,6 +365,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Current Line Highlight",
@@ -348,6 +377,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Selection Highlight",
@@ -359,6 +389,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Rounded Selection",
@@ -368,6 +399,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.editor.rounded_selection,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SectionHeader("Guides"),
SettingsPageItem::SettingItem(SettingItem {
@@ -390,29 +422,26 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER | LOCAL,
}),
// todo(settings_ui): This needs a custom component
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Wrap Guides",
- // description: "Character counts at which to show wrap guides",
- // field: Box::new(SettingField {
- // pick: |settings_content| {
- // &settings_content
- // .project
- // .all_languages
- // .defaults
- // .wrap_guides
- // },
- // pick_mut: |settings_content| {
- // &mut settings_content
- // .project
- // .all_languages
- // .defaults
- // .wrap_guides
- // },
- // }),
- // metadata: None,
- // }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Wrap Guides",
+ description: "Character counts at which to show wrap guides",
+ field: Box::new(
+ SettingField {
+ pick: |settings_content| {
+ &settings_content.project.all_languages.defaults.wrap_guides
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.project.all_languages.defaults.wrap_guides
+ },
+ }
+ .unimplemented(),
+ ),
+ metadata: None,
+ files: USER | LOCAL,
+ }),
SettingsPageItem::SectionHeader("Whitespace"),
SettingsPageItem::SettingItem(SettingItem {
title: "Show Whitespace",
@@ -434,6 +463,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER | LOCAL,
}),
SettingsPageItem::SectionHeader("Layout"),
SettingsPageItem::SettingItem(SettingItem {
@@ -446,7 +476,9 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
+ // files: USER,
// SettingsPageItem::SettingItem(SettingItem {
// title: "Centered Layout Left Padding",
// description: "Left padding for centered layout",
@@ -472,6 +504,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
// }),
// metadata: None,
// }),
+ // files: USER,
// SettingsPageItem::SettingItem(SettingItem {
// title: "Centered Layout Right Padding",
// description: "Right padding for centered layout",
@@ -505,6 +538,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
pick_mut: |settings_content| &mut settings_content.workspace.zoomed_padding,
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Use System Window Tabs",
@@ -516,6 +550,7 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SectionHeader("Window"),
// todo(settings_ui): Should we filter by platform?
@@ -529,3947 +564,3457 @@ pub(crate) fn user_settings_data() -> Vec<SettingsPage> {
},
}),
metadata: None,
+ files: USER,
}),
],
},
SettingsPage {
title: "Editor",
+ items: {
+ let mut items = vec![
+ SettingsPageItem::SectionHeader("Search"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Search Wrap",
+ description: "Whether the editor search results will loop",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.search_wrap,
+ pick_mut: |settings_content| &mut settings_content.editor.search_wrap,
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Seed Search Query From Cursor",
+ description: "When to populate a new search's query based on the text under the cursor",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.seed_search_query_from_cursor
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.seed_search_query_from_cursor
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Use Smartcase Search",
+ description: "Whether to use smartcase (i.e., case-sensitive) search",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.use_smartcase_search,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.use_smartcase_search
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Editor Behavior"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Redact Private Values",
+ description: "Hide the values of variables in private files",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.redact_private_values,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.redact_private_values
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Middle Click Paste",
+ description: "Whether to enable middle-click paste on Linux",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.middle_click_paste,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.middle_click_paste
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Double Click In Multibuffer",
+ description: "What to do when multibuffer is double-clicked in some of its excerpts",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.double_click_in_multibuffer
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.double_click_in_multibuffer
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Go To Definition Fallback",
+ description: "Whether to follow-up empty go to definition responses from the language server",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.go_to_definition_fallback
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.go_to_definition_fallback
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Expand Excerpt Lines",
+ description: "How many lines to expand the multibuffer excerpts by default",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.expand_excerpt_lines,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.expand_excerpt_lines
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Excerpt Context Lines",
+ description: "How many lines of context to provide in multibuffer excerpts by default",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.excerpt_context_lines,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.excerpt_context_lines
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Minimum Contrast For Highlights",
+ description: "The minimum APCA perceptual contrast to maintain when rendering text over highlight backgrounds",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.minimum_contrast_for_highlights
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.minimum_contrast_for_highlights
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Scrolling"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Scroll Beyond Last Line",
+ description: "Whether the editor will scroll beyond the last line",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.scroll_beyond_last_line
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.scroll_beyond_last_line
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Vertical Scroll Margin",
+ description: "The number of lines to keep above/below the cursor when auto-scrolling",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.vertical_scroll_margin
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.vertical_scroll_margin
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Horizontal Scroll Margin",
+ description: "The number of characters to keep on either side when scrolling with the mouse",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.horizontal_scroll_margin
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.horizontal_scroll_margin
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Scroll Sensitivity",
+ description: "Scroll sensitivity multiplier for both horizontal and vertical scrolling",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.scroll_sensitivity,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.scroll_sensitivity
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Fast Scroll Sensitivity",
+ description: "Fast Scroll sensitivity multiplier for both horizontal and vertical scrolling",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.fast_scroll_sensitivity
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.fast_scroll_sensitivity
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Autoscroll On Clicks",
+ description: "Whether to scroll when clicking near the edge of the visible text area",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.autoscroll_on_clicks,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.autoscroll_on_clicks
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Signature Help"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Auto Signature Help",
+ description: "Whether to automatically show a signature help pop-up or not",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.auto_signature_help,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.auto_signature_help
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show Signature Help After Edits",
+ description: "Whether to show the signature help pop-up after completions or bracket pairs inserted",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ &settings_content.editor.show_signature_help_after_edits
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.show_signature_help_after_edits
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Snippet Sort Order",
+ description: "Determines how snippets are sorted relative to other completion items",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.snippet_sort_order,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.snippet_sort_order
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Hover"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Hover Popover Enabled",
+ description: "Whether to show the informational hover box when moving the mouse over symbols in the editor",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.hover_popover_enabled,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.hover_popover_enabled
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ // todo(settings ui): add units to this number input
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Hover Popover Delay",
+ description: "Time to wait in milliseconds before showing the informational hover box",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.hover_popover_delay,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.hover_popover_delay
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Code Actions"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Inline Code Actions",
+ description: "Whether to show code action button at start of buffer line",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.inline_code_actions,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.inline_code_actions
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Selection"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Drag And Drop Selection",
+ description: "Whether to enable drag and drop selection",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(drag_and_drop) =
+ &settings_content.editor.drag_and_drop_selection
+ {
+ &drag_and_drop.enabled
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .drag_and_drop_selection
+ .get_or_insert_default()
+ .enabled
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Drag And Drop Selection Delay",
+ description: "Delay in milliseconds before drag and drop selection starts",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(drag_and_drop) =
+ &settings_content.editor.drag_and_drop_selection
+ {
+ &drag_and_drop.delay
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .drag_and_drop_selection
+ .get_or_insert_default()
+ .delay
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Gutter"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show Line Numbers",
+ description: "Whether to show line numbers in the gutter",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(gutter) = &settings_content.editor.gutter {
+ &gutter.line_numbers
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .gutter
+ .get_or_insert_default()
+ .line_numbers
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Relative Line Numbers",
+ description: "Whether the line numbers on editors gutter are relative or not",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.relative_line_numbers,
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.relative_line_numbers
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show Runnables",
+ description: "Whether to show runnable buttons in the gutter",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(gutter) = &settings_content.editor.gutter {
+ &gutter.runnables
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .gutter
+ .get_or_insert_default()
+ .runnables
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show Breakpoints",
+ description: "Whether to show breakpoints in the gutter",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(gutter) = &settings_content.editor.gutter {
+ &gutter.breakpoints
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .gutter
+ .get_or_insert_default()
+ .breakpoints
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show Folds",
+ description: "Whether to show code folding controls in the gutter",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(gutter) = &settings_content.editor.gutter {
+ &gutter.folds
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.gutter.get_or_insert_default().folds
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Min Line Number Digits",
+ description: "Minimum number of characters to reserve space for in the gutter.",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(gutter) = &settings_content.editor.gutter {
+ &gutter.min_line_number_digits
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .gutter
+ .get_or_insert_default()
+ .min_line_number_digits
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Scrollbar"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show",
+ description: "When to show the scrollbar in the editor",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ &scrollbar.show
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .show
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Cursors",
+ description: "Whether to show cursor positions in the scrollbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ &scrollbar.cursors
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .cursors
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Git Diff",
+ description: "Whether to show git diff indicators in the scrollbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ &scrollbar.git_diff
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .git_diff
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Search Results",
+ description: "Whether to show buffer search result indicators in the scrollbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ &scrollbar.search_results
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .search_results
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Selected Text",
+ description: "Whether to show selected text occurrences in the scrollbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ &scrollbar.selected_text
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .selected_text
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Selected Symbol",
+ description: "Whether to show selected symbol occurrences in the scrollbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ &scrollbar.selected_symbol
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .selected_symbol
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Diagnostics",
+ description: "Which diagnostic indicators to show in the scrollbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ &scrollbar.diagnostics
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .diagnostics
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Horizontal Scrollbar",
+ description: "When false, forcefully disables the horizontal scrollbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ if let Some(axes) = &scrollbar.axes {
+ &axes.horizontal
+ } else {
+ &None
+ }
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .axes
+ .get_or_insert_default()
+ .horizontal
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Vertical Scrollbar",
+ description: "When false, forcefully disables the vertical scrollbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(scrollbar) = &settings_content.editor.scrollbar {
+ if let Some(axes) = &scrollbar.axes {
+ &axes.vertical
+ } else {
+ &None
+ }
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .scrollbar
+ .get_or_insert_default()
+ .axes
+ .get_or_insert_default()
+ .vertical
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Minimap"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show",
+ description: "When to show the minimap in the editor",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(minimap) = &settings_content.editor.minimap {
+ &minimap.show
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.editor.minimap.get_or_insert_default().show
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Display In",
+ description: "Where to show the minimap in the editor",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(minimap) = &settings_content.editor.minimap {
+ &minimap.display_in
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .minimap
+ .get_or_insert_default()
+ .display_in
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Thumb",
+ description: "When to show the minimap thumb",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(minimap) = &settings_content.editor.minimap {
+ &minimap.thumb
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .minimap
+ .get_or_insert_default()
+ .thumb
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Thumb Border",
+ description: "Border style for the minimap's scrollbar thumb",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(minimap) = &settings_content.editor.minimap {
+ &minimap.thumb_border
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .minimap
+ .get_or_insert_default()
+ .thumb_border
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Current Line Highlight",
+ description: "How to highlight the current line in the minimap",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(minimap) = &settings_content.editor.minimap
+ && minimap.current_line_highlight.is_some()
+ {
+ &minimap.current_line_highlight
+ } else {
+ &settings_content.editor.current_line_highlight
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .minimap
+ .get_or_insert_default()
+ .current_line_highlight
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Max Width Columns",
+ description: "Maximum number of columns to display in the minimap",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(minimap) = &settings_content.editor.minimap {
+ &minimap.max_width_columns
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .minimap
+ .get_or_insert_default()
+ .max_width_columns
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("Tabs"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show Tab Bar",
+ description: "Whether or not to show the tab bar in the editor",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(tab_bar) = &settings_content.tab_bar {
+ &tab_bar.show
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.tab_bar.get_or_insert_default().show
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show Git Status In Tabs",
+ description: "Whether to show the Git file status on a tab item",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(tabs) = &settings_content.tabs {
+ &tabs.git_status
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.tabs.get_or_insert_default().git_status
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show File Icons In Tabs",
+ description: "Whether to show the file icon for a tab",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(tabs) = &settings_content.tabs {
+ &tabs.file_icons
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.tabs.get_or_insert_default().file_icons
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Tab Close Position",
+ description: "Position of the close button in a tab",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(tabs) = &settings_content.tabs {
+ &tabs.close_position
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.tabs.get_or_insert_default().close_position
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ // files: USER,
+ // SettingsPageItem::SettingItem(SettingItem {
+ // title: "Maximum Tabs",
+ // description: "Maximum open tabs in a pane. Will not close an unsaved tab",
+ // // todo(settings_ui): The default for this value is null and it's use in code
+ // // is complex, so I'm going to come back to this later
+ // field: Box::new(SettingField {
+ // pick: |settings_content| &settings_content.workspace.max_tabs,
+ // pick_mut: |settings_content| &mut settings_content.workspace.max_tabs,
+ // }),
+ // metadata: None,
+ // }),
+ SettingsPageItem::SectionHeader("Toolbar"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Breadcrumbs",
+ description: "Whether to show breadcrumbs",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(toolbar) = &settings_content.editor.toolbar {
+ &toolbar.breadcrumbs
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .toolbar
+ .get_or_insert_default()
+ .breadcrumbs
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Quick Actions",
+ description: "Whether to show quick action buttons (e.g., search, selection, editor controls, etc.)",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(toolbar) = &settings_content.editor.toolbar {
+ &toolbar.quick_actions
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .toolbar
+ .get_or_insert_default()
+ .quick_actions
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Selections Menu",
+ description: "Whether to show the selections menu in the editor toolbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(toolbar) = &settings_content.editor.toolbar {
+ &toolbar.selections_menu
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .toolbar
+ .get_or_insert_default()
+ .selections_menu
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Agent Review",
+ description: "Whether to show agent review buttons in the editor toolbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(toolbar) = &settings_content.editor.toolbar {
+ &toolbar.agent_review
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .toolbar
+ .get_or_insert_default()
+ .agent_review
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Code Actions",
+ description: "Whether to show code action buttons in the editor toolbar",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(toolbar) = &settings_content.editor.toolbar {
+ &toolbar.code_actions
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content
+ .editor
+ .toolbar
+ .get_or_insert_default()
+ .code_actions
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ ];
+ items.extend(language_settings_data());
+ items
+ },
+ },
+ SettingsPage {
+ title: "Languages",
+ items: vec![
+ SettingsPageItem::SectionHeader(LANGUAGES_SECTION_HEADER),
+ SettingsPageItem::SubPageLink(SubPageLink {
+ title: "JSON",
+ files: USER | LOCAL,
+ render: Arc::new(|this, window, cx| {
+ this.render_page_items(language_settings_data().iter(), window, cx)
+ .into_any_element()
+ }),
+ }),
+ SettingsPageItem::SubPageLink(SubPageLink {
+ title: "JSONC",
+ files: USER | LOCAL,
+ render: Arc::new(|this, window, cx| {
+ this.render_page_items(language_settings_data().iter(), window, cx)
+ .into_any_element()
+ }),
+ }),
+ SettingsPageItem::SubPageLink(SubPageLink {
+ title: "Rust",
+ files: USER | LOCAL,
+ render: Arc::new(|this, window, cx| {
+ this.render_page_items(language_settings_data().iter(), window, cx)
+ .into_any_element()
+ }),
+ }),
+ SettingsPageItem::SubPageLink(SubPageLink {
+ title: "Python",
+ files: USER | LOCAL,
+ render: Arc::new(|this, window, cx| {
+ this.render_page_items(language_settings_data().iter(), window, cx)
+ .into_any_element()
+ }),
+ }),
+ SettingsPageItem::SubPageLink(SubPageLink {
+ title: "TSX",
+ files: USER | LOCAL,
+ render: Arc::new(|this, window, cx| {
+ this.render_page_items(language_settings_data().iter(), window, cx)
+ .into_any_element()
+ }),
+ }),
+ ],
+ },
+ SettingsPage {
+ title: "Workbench & Window",
items: vec![
- SettingsPageItem::SectionHeader("Indentation"),
+ SettingsPageItem::SectionHeader("Status Bar"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Tab Size",
- description: "How many columns a tab should occupy",
+ title: "Active Language Button",
+ description: "Whether to show the active language button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content.project.all_languages.defaults.tab_size
+ if let Some(status_bar) = &settings_content.status_bar {
+ &status_bar.active_language_button
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
- &mut settings_content.project.all_languages.defaults.tab_size
+ &mut settings_content
+ .status_bar
+ .get_or_insert_default()
+ .active_language_button
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Hard Tabs",
- description: "Whether to indent lines using tab characters, as opposed to multiple spaces",
+ title: "Cursor Position Button",
+ description: "Whether to show the cursor position button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content.project.all_languages.defaults.hard_tabs
+ if let Some(status_bar) = &settings_content.status_bar {
+ &status_bar.cursor_position_button
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
- &mut settings_content.project.all_languages.defaults.hard_tabs
+ &mut settings_content
+ .status_bar
+ .get_or_insert_default()
+ .cursor_position_button
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Indent",
- description: "Whether indentation should be adjusted based on the context whilst typing",
+ title: "Terminal Button",
+ description: "Whether to show the terminal button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content.project.all_languages.defaults.auto_indent
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.button
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
- &mut settings_content.project.all_languages.defaults.auto_indent
+ &mut settings_content.terminal.get_or_insert_default().button
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Indent On Paste",
- description: "Whether indentation of pasted content should be adjusted based on the context",
+ title: "Diagnostics Button",
+ description: "Whether to show the project diagnostics button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .auto_indent_on_paste
+ if let Some(diagnostics) = &settings_content.diagnostics {
+ &diagnostics.button
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .auto_indent_on_paste
+ &mut settings_content.diagnostics.get_or_insert_default().button
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Wrapping"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Preferred Line Length",
- description: "The column at which to soft-wrap lines, for buffers where soft-wrap is enabled",
+ title: "Project Search Button",
+ description: "Whether to show the project search button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .preferred_line_length
+ if let Some(search) = &settings_content.editor.search {
+ &search.button
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .preferred_line_length
+ .editor
+ .search
+ .get_or_insert_default()
+ .button
},
}),
metadata: None,
+ files: USER,
}),
+ SettingsPageItem::SectionHeader("Tab Bar"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Soft Wrap",
- description: "How to soft-wrap long lines of text",
+ title: "Editor Tabs",
+ description: "Whether or not to show the tab bar in the editor",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content.project.all_languages.defaults.soft_wrap
- },
- pick_mut: |settings_content| {
- &mut settings_content.project.all_languages.defaults.soft_wrap
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Search"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Search Wrap",
- description: "Whether the editor search results will loop",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.search_wrap,
- pick_mut: |settings_content| &mut settings_content.editor.search_wrap,
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Seed Search Query From Cursor",
- description: "When to populate a new search's query based on the text under the cursor",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content.editor.seed_search_query_from_cursor
+ if let Some(tab_bar) = &settings_content.tab_bar {
+ &tab_bar.show
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
- &mut settings_content.editor.seed_search_query_from_cursor
+ &mut settings_content.tab_bar.get_or_insert_default().show
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Use Smartcase Search",
- description: "Whether to use smartcase (i.e., case-sensitive) search",
+ title: "Show Navigation History Buttons",
+ description: "Whether or not to show the navigation history buttons in the tab bar",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.use_smartcase_search,
+ pick: |settings_content| {
+ if let Some(tab_bar) = &settings_content.tab_bar {
+ &tab_bar.show_nav_history_buttons
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.use_smartcase_search
+ &mut settings_content
+ .tab_bar
+ .get_or_insert_default()
+ .show_nav_history_buttons
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Editor Behavior"),
+ SettingsPageItem::SectionHeader("Title Bar"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Redact Private Values",
- description: "Hide the values of variables in private files",
+ title: "Show Branch Icon",
+ description: "Whether to show the branch icon beside branch switcher in the titlebar",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.redact_private_values,
+ pick: |settings_content| {
+ if let Some(title_bar) = &settings_content.title_bar {
+ &title_bar.show_branch_icon
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.redact_private_values
+ &mut settings_content
+ .title_bar
+ .get_or_insert_default()
+ .show_branch_icon
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Middle Click Paste",
- description: "Whether to enable middle-click paste on Linux",
+ title: "Show Branch Name",
+ description: "Whether to show the branch name button in the titlebar",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.middle_click_paste,
+ pick: |settings_content| {
+ if let Some(title_bar) = &settings_content.title_bar {
+ &title_bar.show_branch_name
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.middle_click_paste
+ &mut settings_content
+ .title_bar
+ .get_or_insert_default()
+ .show_branch_name
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Double Click In Multibuffer",
- description: "What to do when multibuffer is double-clicked in some of its excerpts",
+ title: "Show Project Items",
+ description: "Whether to show the project host and name in the titlebar",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content.editor.double_click_in_multibuffer
+ if let Some(title_bar) = &settings_content.title_bar {
+ &title_bar.show_project_items
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
- &mut settings_content.editor.double_click_in_multibuffer
+ &mut settings_content
+ .title_bar
+ .get_or_insert_default()
+ .show_project_items
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Go To Definition Fallback",
- description: "Whether to follow-up empty go to definition responses from the language server",
+ title: "Show Onboarding Banner",
+ description: "Whether to show onboarding banners in the titlebar",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.go_to_definition_fallback,
+ pick: |settings_content| {
+ if let Some(title_bar) = &settings_content.title_bar {
+ &title_bar.show_onboarding_banner
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.go_to_definition_fallback
+ &mut settings_content
+ .title_bar
+ .get_or_insert_default()
+ .show_onboarding_banner
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Expand Excerpt Lines",
- description: "How many lines to expand the multibuffer excerpts by default",
+ title: "Show User Picture",
+ description: "Whether to show user picture in the titlebar",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.expand_excerpt_lines,
+ pick: |settings_content| {
+ if let Some(title_bar) = &settings_content.title_bar {
+ &title_bar.show_user_picture
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.expand_excerpt_lines
+ &mut settings_content
+ .title_bar
+ .get_or_insert_default()
+ .show_user_picture
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Excerpt Context Lines",
- description: "How many lines of context to provide in multibuffer excerpts by default",
+ title: "Show Sign In",
+ description: "Whether to show the sign in button in the titlebar",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.excerpt_context_lines,
+ pick: |settings_content| {
+ if let Some(title_bar) = &settings_content.title_bar {
+ &title_bar.show_sign_in
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.excerpt_context_lines
+ &mut settings_content
+ .title_bar
+ .get_or_insert_default()
+ .show_sign_in
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Minimum Contrast For Highlights",
- description: "The minimum APCA perceptual contrast to maintain when rendering text over highlight backgrounds",
+ title: "Show Menus",
+ description: "Whether to show the menus in the titlebar",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content.editor.minimum_contrast_for_highlights
+ if let Some(title_bar) = &settings_content.title_bar {
+ &title_bar.show_menus
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
- &mut settings_content.editor.minimum_contrast_for_highlights
+ &mut settings_content
+ .title_bar
+ .get_or_insert_default()
+ .show_menus
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Scrolling"),
+ SettingsPageItem::SectionHeader("Tab Settings"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Scroll Beyond Last Line",
- description: "Whether the editor will scroll beyond the last line",
+ title: "Activate On Close",
+ description: "What to do after closing the current tab",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.scroll_beyond_last_line,
+ pick: |settings_content| {
+ if let Some(tabs) = &settings_content.tabs {
+ &tabs.activate_on_close
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.scroll_beyond_last_line
+ &mut settings_content
+ .tabs
+ .get_or_insert_default()
+ .activate_on_close
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Vertical Scroll Margin",
- description: "The number of lines to keep above/below the cursor when auto-scrolling",
+ title: "Tab Show Diagnostics",
+ description: "Which files containing diagnostic errors/warnings to mark in the tabs",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.vertical_scroll_margin,
+ pick: |settings_content| {
+ if let Some(tabs) = &settings_content.tabs {
+ &tabs.show_diagnostics
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.vertical_scroll_margin
+ &mut settings_content
+ .tabs
+ .get_or_insert_default()
+ .show_diagnostics
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Horizontal Scroll Margin",
- description: "The number of characters to keep on either side when scrolling with the mouse",
+ title: "Show Close Button",
+ description: "Controls the appearance behavior of the tab's close button",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.horizontal_scroll_margin,
+ pick: |settings_content| {
+ if let Some(tabs) = &settings_content.tabs {
+ &tabs.show_close_button
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.horizontal_scroll_margin
+ &mut settings_content
+ .tabs
+ .get_or_insert_default()
+ .show_close_button
},
}),
metadata: None,
+ files: USER,
}),
+ SettingsPageItem::SectionHeader("Preview Tabs"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Scroll Sensitivity",
- description: "Scroll sensitivity multiplier for both horizontal and vertical scrolling",
+ title: "Preview Tabs Enabled",
+ description: "Whether to show opened editors as preview tabs",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.scroll_sensitivity,
+ pick: |settings_content| {
+ if let Some(preview_tabs) = &settings_content.preview_tabs {
+ &preview_tabs.enabled
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.scroll_sensitivity
+ &mut settings_content
+ .preview_tabs
+ .get_or_insert_default()
+ .enabled
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Fast Scroll Sensitivity",
- description: "Fast Scroll sensitivity multiplier for both horizontal and vertical scrolling",
+ title: "Enable Preview From File Finder",
+ description: "Whether to open tabs in preview mode when selected from the file finder",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.fast_scroll_sensitivity,
+ pick: |settings_content| {
+ if let Some(preview_tabs) = &settings_content.preview_tabs {
+ &preview_tabs.enable_preview_from_file_finder
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.fast_scroll_sensitivity
+ &mut settings_content
+ .preview_tabs
+ .get_or_insert_default()
+ .enable_preview_from_file_finder
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Autoscroll On Clicks",
- description: "Whether to scroll when clicking near the edge of the visible text area",
+ title: "Enable Preview From Code Navigation",
+ description: "Whether a preview tab gets replaced when code navigation is used to navigate away from the tab",
field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.autoscroll_on_clicks,
+ pick: |settings_content| {
+ if let Some(preview_tabs) = &settings_content.preview_tabs {
+ &preview_tabs.enable_preview_from_code_navigation
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
- &mut settings_content.editor.autoscroll_on_clicks
+ &mut settings_content
+ .preview_tabs
+ .get_or_insert_default()
+ .enable_preview_from_code_navigation
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Auto Actions"),
+ SettingsPageItem::SectionHeader("Search Settings"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Use Autoclose",
- description: "Whether to automatically type closing characters for you",
+ title: "Whole Word",
+ description: "Whether to search for whole words by default",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .use_autoclose
+ if let Some(search) = &settings_content.editor.search {
+ &search.whole_word
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .use_autoclose
+ .editor
+ .search
+ .get_or_insert_default()
+ .whole_word
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Use Auto Surround",
- description: "Whether to automatically surround text with characters for you",
+ title: "Case Sensitive",
+ description: "Whether to search case-sensitively by default",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .use_auto_surround
+ if let Some(search) = &settings_content.editor.search {
+ &search.case_sensitive
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .use_auto_surround
+ .editor
+ .search
+ .get_or_insert_default()
+ .case_sensitive
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Use On Type Format",
- description: "Whether to use additional LSP queries to format the code after every trigger symbol input",
+ title: "Include Ignored",
+ description: "Whether to include ignored files in search results by default",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .use_on_type_format
+ if let Some(search) = &settings_content.editor.search {
+ &search.include_ignored
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .use_on_type_format
+ .editor
+ .search
+ .get_or_insert_default()
+ .include_ignored
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Always Treat Brackets As Autoclosed",
- description: "Controls how the editor handles the autoclosed characters",
+ title: "Regex",
+ description: "Whether to use regex search by default",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .always_treat_brackets_as_autoclosed
+ if let Some(search) = &settings_content.editor.search {
+ &search.regex
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .always_treat_brackets_as_autoclosed
+ &mut settings_content.editor.search.get_or_insert_default().regex
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Formatting"),
+ SettingsPageItem::SectionHeader("File Finder"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Remove Trailing Whitespace On Save",
- description: "Whether or not to remove any trailing whitespace from lines of a buffer before saving it",
+ title: "File Icons",
+ description: "Whether to show file icons in the file finder",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .remove_trailing_whitespace_on_save
+ if let Some(file_finder) = &settings_content.file_finder {
+ &file_finder.file_icons
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .remove_trailing_whitespace_on_save
+ .file_finder
+ .get_or_insert_default()
+ .file_icons
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Ensure Final Newline On Save",
- description: "Whether or not to ensure there's a single newline at the end of a buffer when saving it",
+ title: "Modal Max Width",
+ description: "Determines how much space the file finder can take up in relation to the available window width",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .ensure_final_newline_on_save
+ if let Some(file_finder) = &settings_content.file_finder {
+ &file_finder.modal_max_width
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .ensure_final_newline_on_save
+ .file_finder
+ .get_or_insert_default()
+ .modal_max_width
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Extend Comment On Newline",
- description: "Whether to start a new line with a comment when a previous line is a comment as well",
+ title: "Skip Focus For Active In Search",
+ description: "Whether the file finder should skip focus for the active file in search results",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .extend_comment_on_newline
+ if let Some(file_finder) = &settings_content.file_finder {
+ &file_finder.skip_focus_for_active_in_search
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .extend_comment_on_newline
+ .file_finder
+ .get_or_insert_default()
+ .skip_focus_for_active_in_search
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Language Server Completions"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Completions On Input",
- description: "Whether to pop the completions menu while typing in an editor without explicitly requesting it",
+ title: "Git Status",
+ description: "Whether to show the git status in the file finder",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .show_completions_on_input
+ if let Some(file_finder) = &settings_content.file_finder {
+ &file_finder.git_status
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .show_completions_on_input
+ .file_finder
+ .get_or_insert_default()
+ .git_status
},
}),
metadata: None,
+ files: USER,
}),
+ // todo: null by default
+ // files: USER,
+ // SettingsPageItem::SettingItem(SettingItem {
+ // title: "Include Ignored",
+ // description: "Whether to use gitignored files when searching",
+ // field: Box::new(SettingField {
+ // pick: |settings_content| {
+ // if let Some(file_finder) = &settings_content.file_finder {
+ // &file_finder.include_ignored
+ // } else {
+ // &None
+ // }
+ // },
+ // pick_mut: |settings_content| {
+ // &mut settings_content
+ // .file_finder
+ // .get_or_insert_default()
+ // .include_ignored
+ // },
+ // }),
+ // metadata: None,
+ // }),
+ ],
+ },
+ SettingsPage {
+ title: "Panels",
+ items: vec![
+ SettingsPageItem::SectionHeader("Project Panel"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Completion Documentation",
- description: "Whether to display inline and alongside documentation for items in the completions menu",
+ title: "Project Panel Button",
+ description: "Whether to show the project panel button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .show_completion_documentation
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.button
+ } else {
+ &None
+ }
},
pick_mut: |settings_content| {
&mut settings_content
- .project
- .all_languages
- .defaults
- .show_completion_documentation
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Signature Help",
- description: "Whether to automatically show a signature help pop-up or not",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.auto_signature_help,
- pick_mut: |settings_content| {
- &mut settings_content.editor.auto_signature_help
+ .project_panel
+ .get_or_insert_default()
+ .button
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Signature Help After Edits",
- description: "Whether to show the signature help pop-up after completions or bracket pairs inserted",
+ title: "Project Panel Dock",
+ description: "Where to dock the project panel",
field: Box::new(SettingField {
pick: |settings_content| {
- &settings_content.editor.show_signature_help_after_edits
- },
- pick_mut: |settings_content| {
- &mut settings_content.editor.show_signature_help_after_edits
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Snippet Sort Order",
- description: "Determines how snippets are sorted relative to other completion items",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.snippet_sort_order,
- pick_mut: |settings_content| {
- &mut settings_content.editor.snippet_sort_order
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Hover"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Hover Popover Enabled",
- description: "Whether to show the informational hover box when moving the mouse over symbols in the editor",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.hover_popover_enabled,
- pick_mut: |settings_content| {
- &mut settings_content.editor.hover_popover_enabled
- },
- }),
- metadata: None,
- }),
- // todo(settings ui): add units to this numeric stepper
- SettingsPageItem::SettingItem(SettingItem {
- title: "Hover Popover Delay",
- description: "Time to wait in milliseconds before showing the informational hover box",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.hover_popover_delay,
- pick_mut: |settings_content| {
- &mut settings_content.editor.hover_popover_delay
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.dock
+ } else {
+ &None
+ }
},
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Code Actions"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Code Actions",
- description: "Whether to show code action button at start of buffer line",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.inline_code_actions,
pick_mut: |settings_content| {
- &mut settings_content.editor.inline_code_actions
+ &mut settings_content.project_panel.get_or_insert_default().dock
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Selection"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Drag And Drop Selection",
- description: "Whether to enable drag and drop selection",
+ title: "Project Panel Default Width",
+ description: "Default width of the project panel in pixels",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(drag_and_drop) =
- &settings_content.editor.drag_and_drop_selection
- {
- &drag_and_drop.enabled
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.default_width
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .drag_and_drop_selection
+ .project_panel
.get_or_insert_default()
- .enabled
+ .default_width
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Drag And Drop Selection Delay",
- description: "Delay in milliseconds before drag and drop selection starts",
+ title: "Hide .gitignore",
+ description: "Whether to hide the gitignore entries in the project panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(drag_and_drop) =
- &settings_content.editor.drag_and_drop_selection
- {
- &drag_and_drop.delay
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.hide_gitignore
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .drag_and_drop_selection
+ .project_panel
.get_or_insert_default()
- .delay
+ .hide_gitignore
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Gutter"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Line Numbers",
- description: "Whether to show line numbers in the gutter",
+ title: "Entry Spacing",
+ description: "Spacing between worktree entries in the project panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(gutter) = &settings_content.editor.gutter {
- &gutter.line_numbers
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.entry_spacing
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .gutter
+ .project_panel
.get_or_insert_default()
- .line_numbers
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Relative Line Numbers",
- description: "Whether the line numbers on editors gutter are relative or not",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.relative_line_numbers,
- pick_mut: |settings_content| {
- &mut settings_content.editor.relative_line_numbers
+ .entry_spacing
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Runnables",
- description: "Whether to show runnable buttons in the gutter",
+ title: "File Icons",
+ description: "Whether to show folder icons or chevrons for directories in the project panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(gutter) = &settings_content.editor.gutter {
- &gutter.runnables
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.file_icons
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .gutter
+ .project_panel
.get_or_insert_default()
- .runnables
+ .file_icons
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Breakpoints",
- description: "Whether to show breakpoints in the gutter",
+ title: "Folder Icons",
+ description: "Whether to show folder icons or chevrons for directories in the project panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(gutter) = &settings_content.editor.gutter {
- &gutter.breakpoints
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.folder_icons
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .gutter
+ .project_panel
.get_or_insert_default()
- .breakpoints
+ .folder_icons
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Folds",
- description: "Whether to show code folding controls in the gutter",
+ title: "Git Status",
+ description: "Whether to show the git status in the project panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(gutter) = &settings_content.editor.gutter {
- &gutter.folds
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.git_status
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.editor.gutter.get_or_insert_default().folds
+ &mut settings_content
+ .project_panel
+ .get_or_insert_default()
+ .git_status
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Min Line Number Digits",
- description: "Minimum number of characters to reserve space for in the gutter.",
+ title: "Indent Size",
+ description: "Amount of indentation for nested items",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(gutter) = &settings_content.editor.gutter {
- &gutter.min_line_number_digits
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.indent_size
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .gutter
+ .project_panel
.get_or_insert_default()
- .min_line_number_digits
+ .indent_size
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Scrollbar"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show",
- description: "When to show the scrollbar in the editor",
+ title: "Auto Reveal Entries",
+ description: "Whether to reveal it in the project panel automatically when a corresponding project entry becomes active",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- &scrollbar.show
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.auto_reveal_entries
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
+ .project_panel
.get_or_insert_default()
- .show
+ .auto_reveal_entries
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Cursors",
- description: "Whether to show cursor positions in the scrollbar",
+ title: "Starts Open",
+ description: "Whether the project panel should open on startup",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- &scrollbar.cursors
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.starts_open
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
+ .project_panel
.get_or_insert_default()
- .cursors
+ .starts_open
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Git Diff",
- description: "Whether to show git diff indicators in the scrollbar",
+ title: "Auto Fold Directories",
+ description: "Whether to fold directories automatically and show compact folders when a directory has only one subdirectory inside",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- &scrollbar.git_diff
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.auto_fold_dirs
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
+ .project_panel
.get_or_insert_default()
- .git_diff
+ .auto_fold_dirs
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Search Results",
- description: "Whether to show buffer search result indicators in the scrollbar",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- &scrollbar.search_results
- } else {
- &None
- }
- },
+ // files: USER,
+ // SettingsPageItem::SettingItem(SettingItem {
+ // title: "Scrollbar Show",
+ // description: "When to show the scrollbar in the project panel",
+ // field: Box::new(SettingField {
+ // pick: |settings_content| {
+ // if let Some(project_panel) = &settings_content.project_panel {
+ // if let Some(scrollbar) = &project_panel.scrollbar {
+ // &scrollbar.show
+ // } else {
+ // &None
+ // }
+ // } else {
+ // &None
+ // }
+ // },
+ // pick_mut: |settings_content| {
+ // &mut settings_content
+ // .project_panel
+ // .get_or_insert_default()
+ // .scrollbar
+ // },
+ // }),
+ // metadata: None,
+ // }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Show Diagnostics",
+ description: "Which files containing diagnostic errors/warnings to mark in the project panel",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.show_diagnostics
+ } else {
+ &None
+ }
+ },
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
+ .project_panel
.get_or_insert_default()
- .search_results
+ .show_diagnostics
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Selected Text",
- description: "Whether to show selected text occurrences in the scrollbar",
+ title: "Sticky Scroll",
+ description: "Whether to stick parent directories at top of the project panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- &scrollbar.selected_text
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.sticky_scroll
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
+ .project_panel
.get_or_insert_default()
- .selected_text
+ .sticky_scroll
},
}),
metadata: None,
+ files: USER,
}),
+ // files: USER,
+ // SettingsPageItem::SettingItem(SettingItem {
+ // title: "Indent Guides Show",
+ // description: "When to show indent guides in the project panel",
+ // field: Box::new(SettingField {
+ // pick: |settings_content| {
+ // if let Some(project_panel) = &settings_content.project_panel {
+ // if let Some(indent_guides) = &project_panel.indent_guides {
+ // &indent_guides.show
+ // } else {
+ // &None
+ // }
+ // } else {
+ // &None
+ // }
+ // },
+ // pick_mut: |settings_content| {
+ // &mut settings_content
+ // .project_panel
+ // .get_or_insert_default()
+ // .indent_guides
+ // .get_or_insert_default()
+ // .show
+ // },
+ // }),
+ // metadata: None,
+ // }),
SettingsPageItem::SettingItem(SettingItem {
- title: "Selected Symbol",
- description: "Whether to show selected symbol occurrences in the scrollbar",
+ title: "Drag and Drop",
+ description: "Whether to enable drag-and-drop operations in the project panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- &scrollbar.selected_symbol
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.drag_and_drop
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
+ .project_panel
.get_or_insert_default()
- .selected_symbol
+ .drag_and_drop
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Diagnostics",
- description: "Which diagnostic indicators to show in the scrollbar",
+ title: "Hide Root",
+ description: "Whether to hide the root entry when only one folder is open in the window",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- &scrollbar.diagnostics
+ if let Some(project_panel) = &settings_content.project_panel {
+ &project_panel.hide_root
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
+ .project_panel
.get_or_insert_default()
- .diagnostics
+ .hide_root
},
}),
metadata: None,
+ files: USER,
}),
+ SettingsPageItem::SectionHeader("Terminal Panel"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Horizontal Scrollbar",
- description: "When false, forcefully disables the horizontal scrollbar",
+ title: "Terminal Dock",
+ description: "Where to dock the terminal panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- if let Some(axes) = &scrollbar.axes {
- &axes.horizontal
- } else {
- &None
- }
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.dock
+ } else {
+ &None
+ }
+ },
+ pick_mut: |settings_content| {
+ &mut settings_content.terminal.get_or_insert_default().dock
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Default Width",
+ description: "Default width when the terminal is docked to the left or right",
+ field: Box::new(SettingField {
+ pick: |settings_content| {
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.default_width
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
- .get_or_insert_default()
- .axes
+ .terminal
.get_or_insert_default()
- .horizontal
+ .default_width
},
}),
metadata: None,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Vertical Scrollbar",
- description: "When false, forcefully disables the vertical scrollbar",
+ title: "Default Height",
+ description: "Default height when the terminal is docked to the bottom",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(scrollbar) = &settings_content.editor.scrollbar {
- if let Some(axes) = &scrollbar.axes {
- &axes.vertical
- } else {
- &None
- }
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.default_height
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .scrollbar
- .get_or_insert_default()
- .axes
+ .terminal
.get_or_insert_default()
- .vertical
+ .default_height
},
}),
metadata: None,
}),
- SettingsPageItem::SectionHeader("Minimap"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show",
- description: "When to show the minimap in the editor",
+ title: "Blinking",
+ description: "Sets the cursor blinking behavior in the terminal",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(minimap) = &settings_content.editor.minimap {
- &minimap.show
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.blinking
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.editor.minimap.get_or_insert_default().show
+ &mut settings_content.terminal.get_or_insert_default().blinking
},
}),
metadata: None,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Display In",
- description: "Where to show the minimap in the editor",
+ title: "Cursor Shape",
+ description: "Default cursor shape for the terminal",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(minimap) = &settings_content.editor.minimap {
- &minimap.display_in
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.cursor_shape
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .minimap
+ .terminal
.get_or_insert_default()
- .display_in
+ .cursor_shape
},
}),
metadata: None,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Thumb",
- description: "When to show the minimap thumb",
+ title: "Alternate Scroll",
+ description: "Sets whether Alternate Scroll mode is active by default",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(minimap) = &settings_content.editor.minimap {
- &minimap.thumb
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.alternate_scroll
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .minimap
+ .terminal
.get_or_insert_default()
- .thumb
+ .alternate_scroll
},
}),
metadata: None,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Thumb Border",
- description: "Border style for the minimap's scrollbar thumb",
+ title: "Option As Meta",
+ description: "Sets whether the option key behaves as the meta key",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(minimap) = &settings_content.editor.minimap {
- &minimap.thumb_border
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.option_as_meta
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .minimap
+ .terminal
.get_or_insert_default()
- .thumb_border
+ .option_as_meta
},
}),
metadata: None,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Current Line Highlight",
- description: "How to highlight the current line in the minimap",
+ title: "Copy On Select",
+ description: "Whether selecting text in the terminal automatically copies to clipboard",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(minimap) = &settings_content.editor.minimap
- && minimap.current_line_highlight.is_some()
- {
- &minimap.current_line_highlight
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.copy_on_select
} else {
- &settings_content.editor.current_line_highlight
+ &None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .minimap
+ .terminal
.get_or_insert_default()
- .current_line_highlight
+ .copy_on_select
},
}),
metadata: None,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Max Width Columns",
- description: "Maximum number of columns to display in the minimap",
+ title: "Keep Selection On Copy",
+ description: "Whether to keep the text selection after copying it to the clipboard",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(minimap) = &settings_content.editor.minimap {
- &minimap.max_width_columns
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.keep_selection_on_copy
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .minimap
+ .terminal
.get_or_insert_default()
- .max_width_columns
+ .keep_selection_on_copy
},
}),
metadata: None,
}),
- SettingsPageItem::SectionHeader("Tabs"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Tab Bar",
- description: "Whether or not to show the tab bar in the editor",
+ title: "Max Scroll History Lines",
+ description: "The maximum number of lines to keep in the scrollback history",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tab_bar) = &settings_content.tab_bar {
- &tab_bar.show
+ if let Some(terminal) = &settings_content.terminal {
+ &terminal.max_scroll_history_lines
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.tab_bar.get_or_insert_default().show
+ &mut settings_content
+ .terminal
+ .get_or_insert_default()
+ .max_scroll_history_lines
},
}),
metadata: None,
}),
+ SettingsPageItem::SectionHeader("Outline Panel"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Git Status In Tabs",
- description: "Whether to show the Git file status on a tab item",
+ title: "Outline Panel Button",
+ description: "Whether to show the outline panel button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tabs) = &settings_content.tabs {
- &tabs.git_status
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.button
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.tabs.get_or_insert_default().git_status
+ &mut settings_content
+ .outline_panel
+ .get_or_insert_default()
+ .button
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show File Icons In Tabs",
- description: "Whether to show the file icon for a tab",
+ title: "Outline Panel Dock",
+ description: "Where to dock the outline panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tabs) = &settings_content.tabs {
- &tabs.file_icons
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.dock
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.tabs.get_or_insert_default().file_icons
+ &mut settings_content.outline_panel.get_or_insert_default().dock
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Tab Close Position",
- description: "Position of the close button in a tab",
+ title: "Outline Panel Default Width",
+ description: "Default width of the outline panel in pixels",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tabs) = &settings_content.tabs {
- &tabs.close_position
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.default_width
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.tabs.get_or_insert_default().close_position
+ &mut settings_content
+ .outline_panel
+ .get_or_insert_default()
+ .default_width
},
}),
metadata: None,
+ files: USER,
}),
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Maximum Tabs",
- // description: "Maximum open tabs in a pane. Will not close an unsaved tab",
- // // todo(settings_ui): The default for this value is null and it's use in code
- // // is complex, so I'm going to come back to this later
- // field: Box::new(SettingField {
- // pick: |settings_content| &settings_content.workspace.max_tabs,
- // pick_mut: |settings_content| &mut settings_content.workspace.max_tabs,
- // }),
- // metadata: None,
- // }),
- SettingsPageItem::SectionHeader("Toolbar"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Breadcrumbs",
- description: "Whether to show breadcrumbs",
+ title: "File Icons",
+ description: "Whether to show file icons in the outline panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(toolbar) = &settings_content.editor.toolbar {
- &toolbar.breadcrumbs
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.file_icons
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .toolbar
+ .outline_panel
.get_or_insert_default()
- .breadcrumbs
+ .file_icons
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Quick Actions",
- description: "Whether to show quick action buttons (e.g., search, selection, editor controls, etc.)",
+ title: "Folder Icons",
+ description: "Whether to show folder icons or chevrons for directories in the outline panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(toolbar) = &settings_content.editor.toolbar {
- &toolbar.quick_actions
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.folder_icons
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .toolbar
+ .outline_panel
.get_or_insert_default()
- .quick_actions
+ .folder_icons
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Selections Menu",
- description: "Whether to show the selections menu in the editor toolbar",
+ title: "Git Status",
+ description: "Whether to show the git status in the outline panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(toolbar) = &settings_content.editor.toolbar {
- &toolbar.selections_menu
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.git_status
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .toolbar
+ .outline_panel
.get_or_insert_default()
- .selections_menu
+ .git_status
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Agent Review",
- description: "Whether to show agent review buttons in the editor toolbar",
+ title: "Indent Size",
+ description: "Amount of indentation for nested items",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(toolbar) = &settings_content.editor.toolbar {
- &toolbar.agent_review
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.indent_size
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .toolbar
+ .outline_panel
.get_or_insert_default()
- .agent_review
+ .indent_size
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Code Actions",
- description: "Whether to show code action buttons in the editor toolbar",
+ title: "Auto Reveal Entries",
+ description: "Whether to reveal when a corresponding outline entry becomes active",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(toolbar) = &settings_content.editor.toolbar {
- &toolbar.code_actions
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.auto_reveal_entries
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .toolbar
+ .outline_panel
.get_or_insert_default()
- .code_actions
+ .auto_reveal_entries
},
}),
metadata: None,
+ files: USER,
}),
- ],
- },
- SettingsPage {
- title: "Languages & Frameworks",
- items: {
- let mut items = vec![
- SettingsPageItem::SectionHeader(LANGUAGES_SECTION_HEADER),
- SettingsPageItem::SubPageLink(SubPageLink {
- title: "JSON",
- render: Arc::new(|this, window, cx| {
- this.render_page_items(language_settings_data().iter(), window, cx)
- .into_any_element()
- }),
- }),
- SettingsPageItem::SubPageLink(SubPageLink {
- title: "JSONC",
- render: Arc::new(|this, window, cx| {
- this.render_page_items(language_settings_data().iter(), window, cx)
- .into_any_element()
- }),
- }),
- SettingsPageItem::SubPageLink(SubPageLink {
- title: "Rust",
- render: Arc::new(|this, window, cx| {
- this.render_page_items(language_settings_data().iter(), window, cx)
- .into_any_element()
- }),
- }),
- SettingsPageItem::SubPageLink(SubPageLink {
- title: "Python",
- render: Arc::new(|this, window, cx| {
- this.render_page_items(language_settings_data().iter(), window, cx)
- .into_any_element()
- }),
- }),
- SettingsPageItem::SubPageLink(SubPageLink {
- title: "TSX",
- render: Arc::new(|this, window, cx| {
- this.render_page_items(language_settings_data().iter(), window, cx)
- .into_any_element()
- }),
- }),
- ];
-
- items.push(SettingsPageItem::SectionHeader("Default Language Settings"));
- items.extend(language_settings_data());
-
- items
- },
- },
- SettingsPage {
- title: "Workbench & Window",
- items: vec![
- SettingsPageItem::SectionHeader("Status Bar"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Active Language Button",
- description: "Whether to show the active language button in the status bar",
+ title: "Auto Fold Directories",
+ description: "Whether to fold directories automatically when a directory has only one directory inside",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(status_bar) = &settings_content.status_bar {
- &status_bar.active_language_button
+ if let Some(outline_panel) = &settings_content.outline_panel {
+ &outline_panel.auto_fold_dirs
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .status_bar
+ .outline_panel
.get_or_insert_default()
- .active_language_button
+ .auto_fold_dirs
},
}),
metadata: None,
+ files: USER,
}),
+ // files: USER,
+ // SettingsPageItem::SettingItem(SettingItem {
+ // title: "Indent Guides Show",
+ // description: "When to show indent guides in the outline panel",
+ // field: Box::new(SettingField {
+ // pick: |settings_content| {
+ // if let Some(outline_panel) = &settings_content.outline_panel {
+ // if let Some(indent_guides) = &outline_panel.indent_guides {
+ // &indent_guides.show
+ // } else {
+ // &None
+ // }
+ // } else {
+ // &None
+ // }
+ // },
+ // pick_mut: |settings_content| {
+ // &mut settings_content
+ // .outline_panel
+ // .get_or_insert_default()
+ // .indent_guides
+ // .get_or_insert_default()
+ // .show
+ // },
+ // }),
+ // metadata: None,
+ // }),
+ SettingsPageItem::SectionHeader("Git Panel"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Cursor Position Button",
- description: "Whether to show the cursor position button in the status bar",
+ title: "Button",
+ description: "Whether to show the git panel button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(status_bar) = &settings_content.status_bar {
- &status_bar.cursor_position_button
+ if let Some(git_panel) = &settings_content.git_panel {
+ &git_panel.button
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .status_bar
- .get_or_insert_default()
- .cursor_position_button
+ &mut settings_content.git_panel.get_or_insert_default().button
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Terminal Button",
- description: "Whether to show the terminal button in the status bar",
+ title: "Dock",
+ description: "Where to dock the git panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.button
+ if let Some(git_panel) = &settings_content.git_panel {
+ &git_panel.dock
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.terminal.get_or_insert_default().button
+ &mut settings_content.git_panel.get_or_insert_default().dock
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Diagnostics Button",
- description: "Whether to show the project diagnostics button in the status bar",
+ title: "Default Width",
+ description: "Default width of the git panel in pixels",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(diagnostics) = &settings_content.diagnostics {
- &diagnostics.button
+ if let Some(git_panel) = &settings_content.git_panel {
+ &git_panel.default_width
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.diagnostics.get_or_insert_default().button
+ &mut settings_content
+ .git_panel
+ .get_or_insert_default()
+ .default_width
},
}),
metadata: None,
+ files: USER,
}),
+ SettingsPageItem::SectionHeader("Notification Panel"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Project Search Button",
- description: "Whether to show the project search button in the status bar",
+ title: "Notification Panel Button",
+ description: "Whether to show the notification panel button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(search) = &settings_content.editor.search {
- &search.button
+ if let Some(notification_panel) = &settings_content.notification_panel {
+ ¬ification_panel.button
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .search
+ .notification_panel
.get_or_insert_default()
.button
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Tab Bar"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Editor Tabs",
- description: "Whether or not to show the tab bar in the editor",
+ title: "Notification Panel Dock",
+ description: "Where to dock the notification panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tab_bar) = &settings_content.tab_bar {
- &tab_bar.show
+ if let Some(notification_panel) = &settings_content.notification_panel {
+ ¬ification_panel.dock
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.tab_bar.get_or_insert_default().show
+ &mut settings_content
+ .notification_panel
+ .get_or_insert_default()
+ .dock
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Navigation History Buttons",
- description: "Whether or not to show the navigation history buttons in the tab bar",
+ title: "Notification Panel Default Width",
+ description: "Default width of the notification panel in pixels",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tab_bar) = &settings_content.tab_bar {
- &tab_bar.show_nav_history_buttons
+ if let Some(notification_panel) = &settings_content.notification_panel {
+ ¬ification_panel.default_width
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .tab_bar
+ .notification_panel
.get_or_insert_default()
- .show_nav_history_buttons
+ .default_width
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Title Bar"),
+ SettingsPageItem::SectionHeader("Collaboration Panel"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Branch Icon",
- description: "Whether to show the branch icon beside branch switcher in the titlebar",
+ title: "Collaboration Panel Button",
+ description: "Whether to show the collaboration panel button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(title_bar) = &settings_content.title_bar {
- &title_bar.show_branch_icon
+ if let Some(collaboration_panel) = &settings_content.collaboration_panel
+ {
+ &collaboration_panel.button
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .title_bar
+ .collaboration_panel
.get_or_insert_default()
- .show_branch_icon
+ .button
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Branch Name",
- description: "Whether to show the branch name button in the titlebar",
+ title: "Collaboration Panel Dock",
+ description: "Where to dock the collaboration panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(title_bar) = &settings_content.title_bar {
- &title_bar.show_branch_name
+ if let Some(collaboration_panel) = &settings_content.collaboration_panel
+ {
+ &collaboration_panel.dock
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .title_bar
+ .collaboration_panel
.get_or_insert_default()
- .show_branch_name
+ .dock
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Project Items",
- description: "Whether to show the project host and name in the titlebar",
+ title: "Collaboration Panel Default Width",
+ description: "Default width of the collaboration panel in pixels",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(title_bar) = &settings_content.title_bar {
- &title_bar.show_project_items
+ if let Some(collaboration_panel) = &settings_content.collaboration_panel
+ {
+ &collaboration_panel.default_width
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .title_bar
+ .collaboration_panel
.get_or_insert_default()
- .show_project_items
+ .default_width
},
}),
metadata: None,
+ files: USER,
}),
+ ],
+ },
+ SettingsPage {
+ title: "Version Control",
+ items: vec![
+ SettingsPageItem::SectionHeader("Git"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Onboarding Banner",
- description: "Whether to show onboarding banners in the titlebar",
+ title: "Git Gutter",
+ description: "Control whether git status is shown in the editor's gutter",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(title_bar) = &settings_content.title_bar {
- &title_bar.show_onboarding_banner
+ if let Some(git) = &settings_content.git {
+ &git.git_gutter
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .title_bar
- .get_or_insert_default()
- .show_onboarding_banner
+ &mut settings_content.git.get_or_insert_default().git_gutter
},
}),
metadata: None,
+ files: USER,
}),
+ // todo(settings_ui): Figure out the right default for this value in default.json
SettingsPageItem::SettingItem(SettingItem {
- title: "Show User Picture",
- description: "Whether to show user picture in the titlebar",
+ title: "Gutter Debounce",
+ description: "Debounce threshold in milliseconds after which changes are reflected in the git gutter",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(title_bar) = &settings_content.title_bar {
- &title_bar.show_user_picture
+ if let Some(git) = &settings_content.git {
+ &git.gutter_debounce
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .title_bar
- .get_or_insert_default()
- .show_user_picture
+ &mut settings_content.git.get_or_insert_default().gutter_debounce
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Sign In",
- description: "Whether to show the sign in button in the titlebar",
+ title: "Inline Git Blame",
+ description: "Whether or not to show git blame data inline in the currently focused line",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(title_bar) = &settings_content.title_bar {
- &title_bar.show_sign_in
+ if let Some(git) = &settings_content.git {
+ if let Some(inline_blame) = &git.inline_blame {
+ &inline_blame.enabled
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .title_bar
+ .git
.get_or_insert_default()
- .show_sign_in
+ .inline_blame
+ .get_or_insert_default()
+ .enabled
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Menus",
- description: "Whether to show the menus in the titlebar",
+ title: "Inline Git Blame Delay",
+ description: "The delay after which the inline blame information is shown",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(title_bar) = &settings_content.title_bar {
- &title_bar.show_menus
+ if let Some(git) = &settings_content.git {
+ if let Some(inline_blame) = &git.inline_blame {
+ &inline_blame.delay_ms
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .title_bar
+ .git
.get_or_insert_default()
- .show_menus
+ .inline_blame
+ .get_or_insert_default()
+ .delay_ms
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Tab Settings"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Activate On Close",
- description: "What to do after closing the current tab",
+ title: "Inline Git Blame Padding",
+ description: "Padding between the end of the source line and the start of the inline blame in columns",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tabs) = &settings_content.tabs {
- &tabs.activate_on_close
+ if let Some(git) = &settings_content.git {
+ if let Some(inline_blame) = &git.inline_blame {
+ &inline_blame.padding
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .tabs
+ .git
.get_or_insert_default()
- .activate_on_close
- },
+ .inline_blame
+ .get_or_insert_default()
+ .padding
+ },
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Tab Show Diagnostics",
- description: "Which files containing diagnostic errors/warnings to mark in the tabs",
+ title: "Inline Git Blame Min Column",
+ description: "The minimum column number to show the inline blame information at",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tabs) = &settings_content.tabs {
- &tabs.show_diagnostics
+ if let Some(git) = &settings_content.git {
+ if let Some(inline_blame) = &git.inline_blame {
+ &inline_blame.min_column
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .tabs
+ .git
.get_or_insert_default()
- .show_diagnostics
+ .inline_blame
+ .get_or_insert_default()
+ .min_column
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Close Button",
- description: "Controls the appearance behavior of the tab's close button",
+ title: "Show Commit Summary",
+ description: "Whether to show commit summary as part of the inline blame",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(tabs) = &settings_content.tabs {
- &tabs.show_close_button
+ if let Some(git) = &settings_content.git {
+ if let Some(inline_blame) = &git.inline_blame {
+ &inline_blame.show_commit_summary
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .tabs
+ .git
.get_or_insert_default()
- .show_close_button
+ .inline_blame
+ .get_or_insert_default()
+ .show_commit_summary
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Preview Tabs"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Preview Tabs Enabled",
- description: "Whether to show opened editors as preview tabs",
+ title: "Show Avatar",
+ description: "Whether to show the avatar of the author of the commit",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(preview_tabs) = &settings_content.preview_tabs {
- &preview_tabs.enabled
+ if let Some(git) = &settings_content.git {
+ if let Some(blame) = &git.blame {
+ &blame.show_avatar
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .preview_tabs
+ .git
.get_or_insert_default()
- .enabled
+ .blame
+ .get_or_insert_default()
+ .show_avatar
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Enable Preview From File Finder",
- description: "Whether to open tabs in preview mode when selected from the file finder",
+ title: "Show Author Name In Branch Picker",
+ description: "Whether to show author name as part of the commit information in branch picker",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(preview_tabs) = &settings_content.preview_tabs {
- &preview_tabs.enable_preview_from_file_finder
+ if let Some(git) = &settings_content.git {
+ if let Some(branch_picker) = &git.branch_picker {
+ &branch_picker.show_author_name
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .preview_tabs
+ .git
.get_or_insert_default()
- .enable_preview_from_file_finder
+ .branch_picker
+ .get_or_insert_default()
+ .show_author_name
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Enable Preview From Code Navigation",
- description: "Whether a preview tab gets replaced when code navigation is used to navigate away from the tab",
+ title: "Hunk Style",
+ description: "How git hunks are displayed visually in the editor",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(preview_tabs) = &settings_content.preview_tabs {
- &preview_tabs.enable_preview_from_code_navigation
+ if let Some(git) = &settings_content.git {
+ &git.hunk_style
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .preview_tabs
- .get_or_insert_default()
- .enable_preview_from_code_navigation
+ &mut settings_content.git.get_or_insert_default().hunk_style
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("Search Settings"),
+ ],
+ },
+ SettingsPage {
+ title: "System & Network",
+ items: vec![
+ SettingsPageItem::SectionHeader("Network"),
+ // todo(settings_ui): Proxy needs a default
+ // files: USER,
+ // SettingsPageItem::SettingItem(SettingItem {
+ // title: "Proxy",
+ // description: "The proxy to use for network requests",
+ // field: Box::new(SettingField {
+ // pick: |settings_content| &settings_content.proxy,
+ // pick_mut: |settings_content| &mut settings_content.proxy,
+ // }),
+ // metadata: Some(Box::new(SettingsFieldMetadata {
+ // placeholder: Some("socks5h://localhost:10808"),
+ // })),
+ // }),
SettingsPageItem::SettingItem(SettingItem {
- title: "Whole Word",
- description: "Whether to search for whole words by default",
+ title: "Server URL",
+ description: "The URL of the Zed server to connect to",
field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(search) = &settings_content.editor.search {
- &search.whole_word
- } else {
- &None
- }
- },
+ pick: |settings_content| &settings_content.server_url,
+ pick_mut: |settings_content| &mut settings_content.server_url,
+ }),
+ metadata: Some(Box::new(SettingsFieldMetadata {
+ placeholder: Some("https://zed.dev"),
+ })),
+ files: USER,
+ }),
+ SettingsPageItem::SectionHeader("System"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Auto Update",
+ description: "Whether or not to automatically check for updates",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.auto_update,
+ pick_mut: |settings_content| &mut settings_content.auto_update,
+ }),
+ metadata: None,
+ files: USER,
+ }),
+ ],
+ },
+ SettingsPage {
+ title: "Diagnostics & Errors",
+ items: vec![
+ SettingsPageItem::SectionHeader("Filtering"),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Max Severity",
+ description: "Which level to use to filter out diagnostics displayed in the editor",
+ field: Box::new(SettingField {
+ pick: |settings_content| &settings_content.editor.diagnostics_max_severity,
pick_mut: |settings_content| {
- &mut settings_content
- .editor
- .search
- .get_or_insert_default()
- .whole_word
+ &mut settings_content.editor.diagnostics_max_severity
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Case Sensitive",
- description: "Whether to search case-sensitively by default",
+ title: "Include Warnings",
+ description: "Whether to show warnings or not by default",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(search) = &settings_content.editor.search {
- &search.case_sensitive
+ if let Some(diagnostics) = &settings_content.diagnostics {
+ &diagnostics.include_warnings
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .search
+ .diagnostics
.get_or_insert_default()
- .case_sensitive
+ .include_warnings
},
}),
metadata: None,
+ files: USER,
}),
+ SettingsPageItem::SectionHeader("Inline"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Include Ignored",
- description: "Whether to include ignored files in search results by default",
+ title: "Inline Diagnostics Enabled",
+ description: "Whether to show diagnostics inline or not",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(search) = &settings_content.editor.search {
- &search.include_ignored
+ if let Some(diagnostics) = &settings_content.diagnostics {
+ if let Some(inline) = &diagnostics.inline {
+ &inline.enabled
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .editor
- .search
+ .diagnostics
.get_or_insert_default()
- .include_ignored
+ .inline
+ .get_or_insert_default()
+ .enabled
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Regex",
- description: "Whether to use regex search by default",
+ title: "Inline Update Debounce",
+ description: "The delay in milliseconds to show inline diagnostics after the last diagnostic update",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(search) = &settings_content.editor.search {
- &search.regex
+ if let Some(diagnostics) = &settings_content.diagnostics {
+ if let Some(inline) = &diagnostics.inline {
+ &inline.update_debounce_ms
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.editor.search.get_or_insert_default().regex
+ &mut settings_content
+ .diagnostics
+ .get_or_insert_default()
+ .inline
+ .get_or_insert_default()
+ .update_debounce_ms
},
}),
metadata: None,
+ files: USER,
}),
- SettingsPageItem::SectionHeader("File Finder"),
SettingsPageItem::SettingItem(SettingItem {
- title: "File Icons",
- description: "Whether to show file icons in the file finder",
+ title: "Inline Padding",
+ description: "The amount of padding between the end of the source line and the start of the inline diagnostic",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(file_finder) = &settings_content.file_finder {
- &file_finder.file_icons
+ if let Some(diagnostics) = &settings_content.diagnostics {
+ if let Some(inline) = &diagnostics.inline {
+ &inline.padding
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .file_finder
+ .diagnostics
.get_or_insert_default()
- .file_icons
+ .inline
+ .get_or_insert_default()
+ .padding
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Modal Max Width",
- description: "Determines how much space the file finder can take up in relation to the available window width",
+ title: "Inline Min Column",
+ description: "The minimum column to display inline diagnostics",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(file_finder) = &settings_content.file_finder {
- &file_finder.modal_max_width
+ if let Some(diagnostics) = &settings_content.diagnostics {
+ if let Some(inline) = &diagnostics.inline {
+ &inline.min_column
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .file_finder
+ .diagnostics
.get_or_insert_default()
- .modal_max_width
+ .inline
+ .get_or_insert_default()
+ .min_column
},
}),
metadata: None,
+ files: USER,
}),
+ SettingsPageItem::SectionHeader("Performance"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Skip Focus For Active In Search",
- description: "Whether the file finder should skip focus for the active file in search results",
+ title: "LSP Pull Diagnostics Enabled",
+ description: "Whether to pull for language server-powered diagnostics or not",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(file_finder) = &settings_content.file_finder {
- &file_finder.skip_focus_for_active_in_search
+ if let Some(diagnostics) = &settings_content.diagnostics {
+ if let Some(lsp_pull) = &diagnostics.lsp_pull_diagnostics {
+ &lsp_pull.enabled
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .file_finder
+ .diagnostics
.get_or_insert_default()
- .skip_focus_for_active_in_search
+ .lsp_pull_diagnostics
+ .get_or_insert_default()
+ .enabled
},
}),
metadata: None,
+ files: USER,
}),
+ // todo(settings_ui): Needs unit
SettingsPageItem::SettingItem(SettingItem {
- title: "Git Status",
- description: "Whether to show the git status in the file finder",
+ title: "LSP Pull Debounce",
+ description: "Minimum time to wait before pulling diagnostics from the language server(s)",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(file_finder) = &settings_content.file_finder {
- &file_finder.git_status
+ if let Some(diagnostics) = &settings_content.diagnostics {
+ if let Some(lsp_pull) = &diagnostics.lsp_pull_diagnostics {
+ &lsp_pull.debounce_ms
+ } else {
+ &None
+ }
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .file_finder
+ .diagnostics
.get_or_insert_default()
- .git_status
+ .lsp_pull_diagnostics
+ .get_or_insert_default()
+ .debounce_ms
},
}),
metadata: None,
+ files: USER,
}),
- // todo: null by default
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Include Ignored",
- // description: "Whether to use gitignored files when searching",
- // field: Box::new(SettingField {
- // pick: |settings_content| {
- // if let Some(file_finder) = &settings_content.file_finder {
- // &file_finder.include_ignored
- // } else {
- // &None
- // }
- // },
- // pick_mut: |settings_content| {
- // &mut settings_content
- // .file_finder
- // .get_or_insert_default()
- // .include_ignored
- // },
- // }),
- // metadata: None,
- // }),
],
},
SettingsPage {
- title: "Panels",
+ title: "Debugger",
items: vec![
- SettingsPageItem::SectionHeader("Project Panel"),
+ SettingsPageItem::SectionHeader("General"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Project Panel Button",
- description: "Whether to show the project panel button in the status bar",
+ title: "Stepping Granularity",
+ description: "Determines the stepping granularity for debug operations",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.button
+ if let Some(debugger) = &settings_content.debugger {
+ &debugger.stepping_granularity
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .project_panel
+ .debugger
.get_or_insert_default()
- .button
+ .stepping_granularity
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Project Panel Dock",
- description: "Where to dock the project panel",
+ title: "Save Breakpoints",
+ description: "Whether breakpoints should be reused across Zed sessions",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.dock
+ if let Some(debugger) = &settings_content.debugger {
+ &debugger.save_breakpoints
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content.project_panel.get_or_insert_default().dock
+ &mut settings_content
+ .debugger
+ .get_or_insert_default()
+ .save_breakpoints
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Project Panel Default Width",
- description: "Default width of the project panel in pixels",
+ title: "Timeout",
+ description: "Time in milliseconds until timeout error when connecting to a TCP debug adapter",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.default_width
+ if let Some(debugger) = &settings_content.debugger {
+ &debugger.timeout
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .default_width
+ &mut settings_content.debugger.get_or_insert_default().timeout
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Hide .gitignore",
- description: "Whether to hide the gitignore entries in the project panel",
+ title: "Dock",
+ description: "The dock position of the debug panel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.hide_gitignore
+ if let Some(debugger) = &settings_content.debugger {
+ &debugger.dock
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .hide_gitignore
+ &mut settings_content.debugger.get_or_insert_default().dock
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Entry Spacing",
- description: "Spacing between worktree entries in the project panel",
+ title: "Log DAP Communications",
+ description: "Whether to log messages between active debug adapters and Zed",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.entry_spacing
+ if let Some(debugger) = &settings_content.debugger {
+ &debugger.log_dap_communications
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .project_panel
+ .debugger
.get_or_insert_default()
- .entry_spacing
+ .log_dap_communications
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "File Icons",
- description: "Whether to show folder icons or chevrons for directories in the project panel",
+ title: "Format DAP Log Messages",
+ description: "Whether to format DAP messages when adding them to debug adapter logger",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.file_icons
+ if let Some(debugger) = &settings_content.debugger {
+ &debugger.format_dap_log_messages
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .project_panel
+ .debugger
.get_or_insert_default()
- .file_icons
+ .format_dap_log_messages
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Folder Icons",
- description: "Whether to show folder icons or chevrons for directories in the project panel",
+ title: "Button",
+ description: "Whether to show the debug button in the status bar",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.folder_icons
+ if let Some(debugger) = &settings_content.debugger {
+ &debugger.button
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .folder_icons
+ &mut settings_content.debugger.get_or_insert_default().button
},
}),
metadata: None,
+ files: USER,
}),
+ ],
+ },
+ SettingsPage {
+ title: "Collaboration",
+ items: vec![
+ SettingsPageItem::SectionHeader("Calls"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Git Status",
- description: "Whether to show the git status in the project panel",
+ title: "Mute On Join",
+ description: "Whether the microphone should be muted when joining a channel or a call",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.git_status
+ if let Some(calls) = &settings_content.calls {
+ &calls.mute_on_join
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .git_status
+ &mut settings_content.calls.get_or_insert_default().mute_on_join
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Indent Size",
- description: "Amount of indentation for nested items",
+ title: "Share On Join",
+ description: "Whether your current project should be shared when joining an empty channel",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.indent_size
+ if let Some(calls) = &settings_content.calls {
+ &calls.share_on_join
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .indent_size
+ &mut settings_content.calls.get_or_insert_default().share_on_join
},
}),
metadata: None,
+ files: USER,
}),
+ SettingsPageItem::SectionHeader("Experimental"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Reveal Entries",
- description: "Whether to reveal it in the project panel automatically when a corresponding project entry becomes active",
+ title: "Rodio Audio",
+ description: "Opt into the new audio system",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.auto_reveal_entries
+ if let Some(audio) = &settings_content.audio {
+ &audio.rodio_audio
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .auto_reveal_entries
+ &mut settings_content.audio.get_or_insert_default().rodio_audio
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Starts Open",
- description: "Whether the project panel should open on startup",
+ title: "Auto Microphone Volume",
+ description: "Automatically adjust microphone volume (requires Rodio Audio)",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.starts_open
+ if let Some(audio) = &settings_content.audio {
+ &audio.auto_microphone_volume
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .project_panel
+ .audio
.get_or_insert_default()
- .starts_open
+ .auto_microphone_volume
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Fold Directories",
- description: "Whether to fold directories automatically and show compact folders when a directory has only one subdirectory inside",
+ title: "Auto Speaker Volume",
+ description: "Automatically adjust volume of other call members (requires Rodio Audio)",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.auto_fold_dirs
+ if let Some(audio) = &settings_content.audio {
+ &audio.auto_speaker_volume
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .project_panel
+ .audio
.get_or_insert_default()
- .auto_fold_dirs
+ .auto_speaker_volume
},
}),
metadata: None,
+ files: USER,
}),
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Scrollbar Show",
- // description: "When to show the scrollbar in the project panel",
- // field: Box::new(SettingField {
- // pick: |settings_content| {
- // if let Some(project_panel) = &settings_content.project_panel {
- // if let Some(scrollbar) = &project_panel.scrollbar {
- // &scrollbar.show
- // } else {
- // &None
- // }
- // } else {
- // &None
- // }
- // },
- // pick_mut: |settings_content| {
- // &mut settings_content
- // .project_panel
- // .get_or_insert_default()
- // .scrollbar
- // },
- // }),
- // metadata: None,
- // }),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Diagnostics",
- description: "Which files containing diagnostic errors/warnings to mark in the project panel",
+ title: "Denoise",
+ description: "Remove background noises (requires Rodio Audio)",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.show_diagnostics
+ if let Some(audio) = &settings_content.audio {
+ &audio.denoise
} else {
&None
}
},
pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .show_diagnostics
+ &mut settings_content.audio.get_or_insert_default().denoise
},
}),
metadata: None,
+ files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
- title: "Sticky Scroll",
- description: "Whether to stick parent directories at top of the project panel",
+ title: "Legacy Audio Compatible",
+ description: "Use audio parameters compatible with previous versions (requires Rodio Audio)",
field: Box::new(SettingField {
pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.sticky_scroll
+ if let Some(audio) = &settings_content.audio {
+ &audio.legacy_audio_compatible
} else {
&None
}
},
pick_mut: |settings_content| {
&mut settings_content
- .project_panel
+ .audio
.get_or_insert_default()
- .sticky_scroll
- },
- }),
- metadata: None,
- }),
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Indent Guides Show",
- // description: "When to show indent guides in the project panel",
- // field: Box::new(SettingField {
- // pick: |settings_content| {
- // if let Some(project_panel) = &settings_content.project_panel {
- // if let Some(indent_guides) = &project_panel.indent_guides {
- // &indent_guides.show
- // } else {
- // &None
- // }
- // } else {
- // &None
- // }
- // },
- // pick_mut: |settings_content| {
- // &mut settings_content
- // .project_panel
- // .get_or_insert_default()
- // .indent_guides
- // .get_or_insert_default()
- // .show
- // },
- // }),
- // metadata: None,
- // }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Drag and Drop",
- description: "Whether to enable drag-and-drop operations in the project panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.drag_and_drop
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .drag_and_drop
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Hide Root",
- description: "Whether to hide the root entry when only one folder is open in the window",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(project_panel) = &settings_content.project_panel {
- &project_panel.hide_root
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project_panel
- .get_or_insert_default()
- .hide_root
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Terminal Panel"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Terminal Dock",
- description: "Where to dock the terminal panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.dock
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.terminal.get_or_insert_default().dock
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Default Width",
- description: "Default width when the terminal is docked to the left or right",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.default_width
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .terminal
- .get_or_insert_default()
- .default_width
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Default Height",
- description: "Default height when the terminal is docked to the bottom",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.default_height
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .terminal
- .get_or_insert_default()
- .default_height
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Blinking",
- description: "Sets the cursor blinking behavior in the terminal",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.blinking
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.terminal.get_or_insert_default().blinking
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Cursor Shape",
- description: "Default cursor shape for the terminal",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.cursor_shape
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .terminal
- .get_or_insert_default()
- .cursor_shape
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Alternate Scroll",
- description: "Sets whether Alternate Scroll mode is active by default",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.alternate_scroll
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .terminal
- .get_or_insert_default()
- .alternate_scroll
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Option As Meta",
- description: "Sets whether the option key behaves as the meta key",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.option_as_meta
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .terminal
- .get_or_insert_default()
- .option_as_meta
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Copy On Select",
- description: "Whether selecting text in the terminal automatically copies to clipboard",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.copy_on_select
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .terminal
- .get_or_insert_default()
- .copy_on_select
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Keep Selection On Copy",
- description: "Whether to keep the text selection after copying it to the clipboard",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.keep_selection_on_copy
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .terminal
- .get_or_insert_default()
- .keep_selection_on_copy
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Max Scroll History Lines",
- description: "The maximum number of lines to keep in the scrollback history",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(terminal) = &settings_content.terminal {
- &terminal.max_scroll_history_lines
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .terminal
- .get_or_insert_default()
- .max_scroll_history_lines
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Outline Panel"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Outline Panel Button",
- description: "Whether to show the outline panel button in the status bar",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.button
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .outline_panel
- .get_or_insert_default()
- .button
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Outline Panel Dock",
- description: "Where to dock the outline panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.dock
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.outline_panel.get_or_insert_default().dock
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Outline Panel Default Width",
- description: "Default width of the outline panel in pixels",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.default_width
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .outline_panel
- .get_or_insert_default()
- .default_width
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "File Icons",
- description: "Whether to show file icons in the outline panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.file_icons
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .outline_panel
- .get_or_insert_default()
- .file_icons
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Folder Icons",
- description: "Whether to show folder icons or chevrons for directories in the outline panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.folder_icons
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .outline_panel
- .get_or_insert_default()
- .folder_icons
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Git Status",
- description: "Whether to show the git status in the outline panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.git_status
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .outline_panel
- .get_or_insert_default()
- .git_status
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Indent Size",
- description: "Amount of indentation for nested items",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.indent_size
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .outline_panel
- .get_or_insert_default()
- .indent_size
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Reveal Entries",
- description: "Whether to reveal when a corresponding outline entry becomes active",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.auto_reveal_entries
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .outline_panel
- .get_or_insert_default()
- .auto_reveal_entries
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Fold Directories",
- description: "Whether to fold directories automatically when a directory has only one directory inside",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(outline_panel) = &settings_content.outline_panel {
- &outline_panel.auto_fold_dirs
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .outline_panel
- .get_or_insert_default()
- .auto_fold_dirs
- },
- }),
- metadata: None,
- }),
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Indent Guides Show",
- // description: "When to show indent guides in the outline panel",
- // field: Box::new(SettingField {
- // pick: |settings_content| {
- // if let Some(outline_panel) = &settings_content.outline_panel {
- // if let Some(indent_guides) = &outline_panel.indent_guides {
- // &indent_guides.show
- // } else {
- // &None
- // }
- // } else {
- // &None
- // }
- // },
- // pick_mut: |settings_content| {
- // &mut settings_content
- // .outline_panel
- // .get_or_insert_default()
- // .indent_guides
- // .get_or_insert_default()
- // .show
- // },
- // }),
- // metadata: None,
- // }),
- SettingsPageItem::SectionHeader("Git Panel"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Button",
- description: "Whether to show the git panel button in the status bar",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git_panel) = &settings_content.git_panel {
- &git_panel.button
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.git_panel.get_or_insert_default().button
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Dock",
- description: "Where to dock the git panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git_panel) = &settings_content.git_panel {
- &git_panel.dock
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.git_panel.get_or_insert_default().dock
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Default Width",
- description: "Default width of the git panel in pixels",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git_panel) = &settings_content.git_panel {
- &git_panel.default_width
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .git_panel
- .get_or_insert_default()
- .default_width
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Notification Panel"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Notification Panel Button",
- description: "Whether to show the notification panel button in the status bar",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(notification_panel) = &settings_content.notification_panel {
- ¬ification_panel.button
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .notification_panel
- .get_or_insert_default()
- .button
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Notification Panel Dock",
- description: "Where to dock the notification panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(notification_panel) = &settings_content.notification_panel {
- ¬ification_panel.dock
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .notification_panel
- .get_or_insert_default()
- .dock
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Notification Panel Default Width",
- description: "Default width of the notification panel in pixels",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(notification_panel) = &settings_content.notification_panel {
- ¬ification_panel.default_width
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .notification_panel
- .get_or_insert_default()
- .default_width
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Collaboration Panel"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Collaboration Panel Button",
- description: "Whether to show the collaboration panel button in the status bar",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(collaboration_panel) = &settings_content.collaboration_panel
- {
- &collaboration_panel.button
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .collaboration_panel
- .get_or_insert_default()
- .button
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Collaboration Panel Dock",
- description: "Where to dock the collaboration panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(collaboration_panel) = &settings_content.collaboration_panel
- {
- &collaboration_panel.dock
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .collaboration_panel
- .get_or_insert_default()
- .dock
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Collaboration Panel Default Width",
- description: "Default width of the collaboration panel in pixels",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(collaboration_panel) = &settings_content.collaboration_panel
- {
- &collaboration_panel.default_width
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .collaboration_panel
- .get_or_insert_default()
- .default_width
- },
- }),
- metadata: None,
- }),
- ],
- },
- SettingsPage {
- title: "Version Control",
- items: vec![
- SettingsPageItem::SectionHeader("Git"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Git Gutter",
- description: "Control whether git status is shown in the editor's gutter",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- &git.git_gutter
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.git.get_or_insert_default().git_gutter
- },
- }),
- metadata: None,
- }),
- // todo(settings_ui): Figure out the right default for this value in default.json
- SettingsPageItem::SettingItem(SettingItem {
- title: "Gutter Debounce",
- description: "Debounce threshold in milliseconds after which changes are reflected in the git gutter",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- &git.gutter_debounce
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.git.get_or_insert_default().gutter_debounce
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Git Blame",
- description: "Whether or not to show git blame data inline in the currently focused line",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- if let Some(inline_blame) = &git.inline_blame {
- &inline_blame.enabled
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .git
- .get_or_insert_default()
- .inline_blame
- .get_or_insert_default()
- .enabled
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Git Blame Delay",
- description: "The delay after which the inline blame information is shown",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- if let Some(inline_blame) = &git.inline_blame {
- &inline_blame.delay_ms
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .git
- .get_or_insert_default()
- .inline_blame
- .get_or_insert_default()
- .delay_ms
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Git Blame Padding",
- description: "Padding between the end of the source line and the start of the inline blame in columns",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- if let Some(inline_blame) = &git.inline_blame {
- &inline_blame.padding
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .git
- .get_or_insert_default()
- .inline_blame
- .get_or_insert_default()
- .padding
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Git Blame Min Column",
- description: "The minimum column number to show the inline blame information at",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- if let Some(inline_blame) = &git.inline_blame {
- &inline_blame.min_column
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .git
- .get_or_insert_default()
- .inline_blame
- .get_or_insert_default()
- .min_column
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Show Commit Summary",
- description: "Whether to show commit summary as part of the inline blame",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- if let Some(inline_blame) = &git.inline_blame {
- &inline_blame.show_commit_summary
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .git
- .get_or_insert_default()
- .inline_blame
- .get_or_insert_default()
- .show_commit_summary
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Show Avatar",
- description: "Whether to show the avatar of the author of the commit",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- if let Some(blame) = &git.blame {
- &blame.show_avatar
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .git
- .get_or_insert_default()
- .blame
- .get_or_insert_default()
- .show_avatar
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Show Author Name In Branch Picker",
- description: "Whether to show author name as part of the commit information in branch picker",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- if let Some(branch_picker) = &git.branch_picker {
- &branch_picker.show_author_name
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .git
- .get_or_insert_default()
- .branch_picker
- .get_or_insert_default()
- .show_author_name
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Hunk Style",
- description: "How git hunks are displayed visually in the editor",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(git) = &settings_content.git {
- &git.hunk_style
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.git.get_or_insert_default().hunk_style
- },
- }),
- metadata: None,
- }),
- ],
- },
- SettingsPage {
- title: "System & Network",
- items: vec![
- SettingsPageItem::SectionHeader("Network"),
- // todo(settings_ui): Proxy needs a default
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Proxy",
- // description: "The proxy to use for network requests",
- // field: Box::new(SettingField {
- // pick: |settings_content| &settings_content.proxy,
- // pick_mut: |settings_content| &mut settings_content.proxy,
- // }),
- // metadata: Some(Box::new(SettingsFieldMetadata {
- // placeholder: Some("socks5h://localhost:10808"),
- // })),
- // }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Server URL",
- description: "The URL of the Zed server to connect to",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.server_url,
- pick_mut: |settings_content| &mut settings_content.server_url,
- }),
- metadata: Some(Box::new(SettingsFieldMetadata {
- placeholder: Some("https://zed.dev"),
- })),
- }),
- SettingsPageItem::SectionHeader("System"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Update",
- description: "Whether or not to automatically check for updates",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.auto_update,
- pick_mut: |settings_content| &mut settings_content.auto_update,
- }),
- metadata: None,
- }),
- ],
- },
- SettingsPage {
- title: "Diagnostics & Errors",
- items: vec![
- SettingsPageItem::SectionHeader("Filtering"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Max Severity",
- description: "Which level to use to filter out diagnostics displayed in the editor",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.editor.diagnostics_max_severity,
- pick_mut: |settings_content| {
- &mut settings_content.editor.diagnostics_max_severity
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Include Warnings",
- description: "Whether to show warnings or not by default",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(diagnostics) = &settings_content.diagnostics {
- &diagnostics.include_warnings
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .diagnostics
- .get_or_insert_default()
- .include_warnings
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Inline"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Diagnostics Enabled",
- description: "Whether to show diagnostics inline or not",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(diagnostics) = &settings_content.diagnostics {
- if let Some(inline) = &diagnostics.inline {
- &inline.enabled
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .diagnostics
- .get_or_insert_default()
- .inline
- .get_or_insert_default()
- .enabled
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Update Debounce",
- description: "The delay in milliseconds to show inline diagnostics after the last diagnostic update",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(diagnostics) = &settings_content.diagnostics {
- if let Some(inline) = &diagnostics.inline {
- &inline.update_debounce_ms
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .diagnostics
- .get_or_insert_default()
- .inline
- .get_or_insert_default()
- .update_debounce_ms
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Padding",
- description: "The amount of padding between the end of the source line and the start of the inline diagnostic",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(diagnostics) = &settings_content.diagnostics {
- if let Some(inline) = &diagnostics.inline {
- &inline.padding
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .diagnostics
- .get_or_insert_default()
- .inline
- .get_or_insert_default()
- .padding
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Inline Min Column",
- description: "The minimum column to display inline diagnostics",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(diagnostics) = &settings_content.diagnostics {
- if let Some(inline) = &diagnostics.inline {
- &inline.min_column
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .diagnostics
- .get_or_insert_default()
- .inline
- .get_or_insert_default()
- .min_column
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Performance"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "LSP Pull Diagnostics Enabled",
- description: "Whether to pull for language server-powered diagnostics or not",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(diagnostics) = &settings_content.diagnostics {
- if let Some(lsp_pull) = &diagnostics.lsp_pull_diagnostics {
- &lsp_pull.enabled
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .diagnostics
- .get_or_insert_default()
- .lsp_pull_diagnostics
- .get_or_insert_default()
- .enabled
- },
- }),
- metadata: None,
- }),
- // todo(settings_ui): Needs unit
- SettingsPageItem::SettingItem(SettingItem {
- title: "LSP Pull Debounce",
- description: "Minimum time to wait before pulling diagnostics from the language server(s)",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(diagnostics) = &settings_content.diagnostics {
- if let Some(lsp_pull) = &diagnostics.lsp_pull_diagnostics {
- &lsp_pull.debounce_ms
- } else {
- &None
- }
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .diagnostics
- .get_or_insert_default()
- .lsp_pull_diagnostics
- .get_or_insert_default()
- .debounce_ms
- },
- }),
- metadata: None,
- }),
- ],
- },
- SettingsPage {
- title: "Debugger",
- items: vec![
- SettingsPageItem::SectionHeader("General"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Stepping Granularity",
- description: "Determines the stepping granularity for debug operations",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(debugger) = &settings_content.debugger {
- &debugger.stepping_granularity
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .debugger
- .get_or_insert_default()
- .stepping_granularity
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Save Breakpoints",
- description: "Whether breakpoints should be reused across Zed sessions",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(debugger) = &settings_content.debugger {
- &debugger.save_breakpoints
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .debugger
- .get_or_insert_default()
- .save_breakpoints
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Timeout",
- description: "Time in milliseconds until timeout error when connecting to a TCP debug adapter",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(debugger) = &settings_content.debugger {
- &debugger.timeout
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.debugger.get_or_insert_default().timeout
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Dock",
- description: "The dock position of the debug panel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(debugger) = &settings_content.debugger {
- &debugger.dock
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.debugger.get_or_insert_default().dock
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Log DAP Communications",
- description: "Whether to log messages between active debug adapters and Zed",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(debugger) = &settings_content.debugger {
- &debugger.log_dap_communications
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .debugger
- .get_or_insert_default()
- .log_dap_communications
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Format DAP Log Messages",
- description: "Whether to format DAP messages when adding them to debug adapter logger",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(debugger) = &settings_content.debugger {
- &debugger.format_dap_log_messages
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .debugger
- .get_or_insert_default()
- .format_dap_log_messages
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Button",
- description: "Whether to show the debug button in the status bar",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(debugger) = &settings_content.debugger {
- &debugger.button
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.debugger.get_or_insert_default().button
- },
- }),
- metadata: None,
- }),
- ],
- },
- SettingsPage {
- title: "Collaboration",
- items: vec![
- SettingsPageItem::SectionHeader("Calls"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Mute On Join",
- description: "Whether the microphone should be muted when joining a channel or a call",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(calls) = &settings_content.calls {
- &calls.mute_on_join
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.calls.get_or_insert_default().mute_on_join
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Share On Join",
- description: "Whether your current project should be shared when joining an empty channel",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(calls) = &settings_content.calls {
- &calls.share_on_join
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.calls.get_or_insert_default().share_on_join
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Experimental"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Rodio Audio",
- description: "Opt into the new audio system",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(audio) = &settings_content.audio {
- &audio.rodio_audio
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.audio.get_or_insert_default().rodio_audio
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Microphone Volume",
- description: "Automatically adjust microphone volume (requires Rodio Audio)",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(audio) = &settings_content.audio {
- &audio.auto_microphone_volume
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .audio
- .get_or_insert_default()
- .auto_microphone_volume
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Speaker Volume",
- description: "Automatically adjust volume of other call members (requires Rodio Audio)",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(audio) = &settings_content.audio {
- &audio.auto_speaker_volume
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .audio
- .get_or_insert_default()
- .auto_speaker_volume
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Denoise",
- description: "Remove background noises (requires Rodio Audio)",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(audio) = &settings_content.audio {
- &audio.denoise
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content.audio.get_or_insert_default().denoise
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Legacy Audio Compatible",
- description: "Use audio parameters compatible with previous versions (requires Rodio Audio)",
- field: Box::new(SettingField {
- pick: |settings_content| {
- if let Some(audio) = &settings_content.audio {
- &audio.legacy_audio_compatible
- } else {
- &None
- }
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .audio
- .get_or_insert_default()
- .legacy_audio_compatible
- },
- }),
- metadata: None,
- }),
- ],
- },
- SettingsPage {
- title: "AI",
- items: vec![
- SettingsPageItem::SectionHeader("General"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Disable AI",
- description: "Whether to disable all AI features in Zed",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.disable_ai,
- pick_mut: |settings_content| &mut settings_content.disable_ai,
- }),
- metadata: None,
- }),
- ],
- },
- ]
-}
-
-pub(crate) fn project_settings_data() -> Vec<SettingsPage> {
- vec![
- SettingsPage {
- title: "Project",
- items: vec![
- SettingsPageItem::SectionHeader("Worktree Settings Content"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Project Name",
- description: "The displayed name of this project. If not set, the root directory name",
- field: Box::new(SettingField {
- pick: |settings_content| &settings_content.project.worktree.project_name,
- pick_mut: |settings_content| {
- &mut settings_content.project.worktree.project_name
- },
- }),
- metadata: Some(Box::new(SettingsFieldMetadata {
- placeholder: Some("A new name"),
- })),
- }),
- ],
- },
- SettingsPage {
- title: "Appearance & Behavior",
- items: vec![
- SettingsPageItem::SectionHeader("Guides"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Show Wrap Guides",
- description: "Whether to show wrap guides (vertical rulers)",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .show_wrap_guides
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .show_wrap_guides
- },
- }),
- metadata: None,
- }),
- // todo(settings_ui): This needs a custom component
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Wrap Guides",
- // description: "Character counts at which to show wrap guides",
- // field: Box::new(SettingField {
- // pick: |settings_content| {
- // &settings_content
- // .project
- // .all_languages
- // .defaults
- // .wrap_guides
- // },
- // pick_mut: |settings_content| {
- // &mut settings_content
- // .project
- // .all_languages
- // .defaults
- // .wrap_guides
- // },
- // }),
- // metadata: None,
- // }),
- SettingsPageItem::SectionHeader("Whitespace"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Show Whitespace",
- description: "Whether to show tabs and spaces",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .show_whitespaces
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .show_whitespaces
+ .legacy_audio_compatible
},
}),
metadata: None,
+ files: USER,
}),
],
},
SettingsPage {
- title: "Editing",
+ title: "AI",
items: vec![
- SettingsPageItem::SectionHeader("Indentation"),
- // todo(settings_ui): Needs numeric stepper
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Tab Size",
- // description: "How many columns a tab should occupy",
- // field: Box::new(SettingField {
- // pick: |settings_content| &settings_content.project.all_languages.defaults.tab_size,
- // pick_mut: |settings_content| &mut settings_content.project.all_languages.defaults.tab_size,
- // }),
- // metadata: None,
- // }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Hard Tabs",
- description: "Whether to indent lines using tab characters, as opposed to multiple spaces",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content.project.all_languages.defaults.hard_tabs
- },
- pick_mut: |settings_content| {
- &mut settings_content.project.all_languages.defaults.hard_tabs
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Indent",
- description: "Whether indentation should be adjusted based on the context whilst typing",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content.project.all_languages.defaults.auto_indent
- },
- pick_mut: |settings_content| {
- &mut settings_content.project.all_languages.defaults.auto_indent
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Auto Indent On Paste",
- description: "Whether indentation of pasted content should be adjusted based on the context",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .auto_indent_on_paste
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .auto_indent_on_paste
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Wrapping"),
- // todo(settings_ui): Needs numeric stepper
- // SettingsPageItem::SettingItem(SettingItem {
- // title: "Preferred Line Length",
- // description: "The column at which to soft-wrap lines, for buffers where soft-wrap is enabled",
- // field: Box::new(SettingField {
- // pick: |settings_content| &settings_content.project.all_languages.defaults.preferred_line_length,
- // pick_mut: |settings_content| &mut settings_content.project.all_languages.defaults.preferred_line_length,
- // }),
- // metadata: None,
- // }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Soft Wrap",
- description: "How to soft-wrap long lines of text",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content.project.all_languages.defaults.soft_wrap
- },
- pick_mut: |settings_content| {
- &mut settings_content.project.all_languages.defaults.soft_wrap
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Auto Actions"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Use Autoclose",
- description: "Whether to automatically type closing characters for you",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .use_autoclose
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .use_autoclose
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Use Auto Surround",
- description: "Whether to automatically surround text with characters for you",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .use_auto_surround
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .use_auto_surround
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Use On Type Format",
- description: "Whether to use additional LSP queries to format the code after every trigger symbol input",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .use_on_type_format
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .use_on_type_format
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Always Treat Brackets As Autoclosed",
- description: "Controls how the editor handles the autoclosed characters",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .always_treat_brackets_as_autoclosed
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .always_treat_brackets_as_autoclosed
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Formatting"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Remove Trailing Whitespace On Save",
- description: "Whether or not to remove any trailing whitespace from lines of a buffer before saving it",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .remove_trailing_whitespace_on_save
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .remove_trailing_whitespace_on_save
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Ensure Final Newline On Save",
- description: "Whether or not to ensure there's a single newline at the end of a buffer when saving it",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .ensure_final_newline_on_save
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .ensure_final_newline_on_save
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Extend Comment On Newline",
- description: "Whether to start a new line with a comment when a previous line is a comment as well",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .extend_comment_on_newline
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .extend_comment_on_newline
- },
- }),
- metadata: None,
- }),
- SettingsPageItem::SectionHeader("Completions"),
- SettingsPageItem::SettingItem(SettingItem {
- title: "Show Completions On Input",
- description: "Whether to pop the completions menu while typing in an editor without explicitly requesting it",
- field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .show_completions_on_input
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .show_completions_on_input
- },
- }),
- metadata: None,
- }),
+ SettingsPageItem::SectionHeader("General"),
SettingsPageItem::SettingItem(SettingItem {
- title: "Show Completion Documentation",
- description: "Whether to display inline and alongside documentation for items in the completions menu",
+ title: "Disable AI",
+ description: "Whether to disable all AI features in Zed",
field: Box::new(SettingField {
- pick: |settings_content| {
- &settings_content
- .project
- .all_languages
- .defaults
- .show_completion_documentation
- },
- pick_mut: |settings_content| {
- &mut settings_content
- .project
- .all_languages
- .defaults
- .show_completion_documentation
- },
+ pick: |settings_content| &settings_content.disable_ai,
+ pick_mut: |settings_content| &mut settings_content.disable_ai,
}),
metadata: None,
+ files: USER,
}),
],
},