diff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rs index 7838c99989b625f8c87c0264482dcf36cd6c46d8..5997d14de33bdec4b4739112a02b22ac0f12e2e7 100644 --- a/crates/settings_ui/src/page_data.rs +++ b/crates/settings_ui/src/page_data.rs @@ -31,6 +31,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "The displayed name of this project. If left empty, the root directory name will be displayed.", field: Box::new( SettingField { + json_path: Some("project_name"), pick: |settings_content| { settings_content.project.worktree.project_name.as_ref()?.as_ref().or(DEFAULT_EMPTY_STRING) }, @@ -45,6 +46,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "When Closing With No Tabs", description: "What to do when using the 'close active item' action with no tabs.", field: Box::new(SettingField { + json_path: Some("when_closing_with_no_tabs"), pick: |settings_content| { settings_content .workspace @@ -62,6 +64,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "On Last Window Closed", description: "What to do when the last window is closed.", field: Box::new(SettingField { + json_path: Some("on_last_window_closed"), pick: |settings_content| { settings_content.workspace.on_last_window_closed.as_ref() }, @@ -76,6 +79,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Use System Path Prompts", description: "Use native OS dialogs for 'Open' and 'Save As'.", field: Box::new(SettingField { + json_path: Some("use_system_path_prompts"), pick: |settings_content| { settings_content.workspace.use_system_path_prompts.as_ref() }, @@ -90,6 +94,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Use System Prompts", description: "Use native OS dialogs for confirmations.", field: Box::new(SettingField { + json_path: Some("use_system_prompts"), pick: |settings_content| { settings_content.workspace.use_system_prompts.as_ref() }, @@ -104,6 +109,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Redact Private Values", description: "Hide the values of variables in private files.", field: Box::new(SettingField { + json_path: Some("redact_private_values"), pick: |settings_content| { settings_content.editor.redact_private_values.as_ref() }, @@ -119,6 +125,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Globs to match against file paths to determine if a file is private.", field: Box::new( SettingField { + json_path: Some("worktree.private_files"), pick: |settings_content| { settings_content.project.worktree.private_files.as_ref() }, @@ -136,6 +143,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Restore Unsaved Buffers", description: "Whether or not to restore unsaved buffers on restart.", field: Box::new(SettingField { + json_path: Some("session.restore_unsaved_buffers"), pick: |settings_content| { settings_content .session @@ -156,6 +164,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Restore On Startup", description: "What to restore from the previous session when opening Zed.", field: Box::new(SettingField { + json_path: Some("restore_on_startup"), pick: |settings_content| { settings_content.workspace.restore_on_startup.as_ref() }, @@ -174,6 +183,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Which settings should be activated only in Preview build of Zed.", field: Box::new( SettingField { + json_path: Some("use_system_prompts"), pick: |settings_content| { settings_content.workspace.use_system_prompts.as_ref() }, @@ -191,6 +201,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Any number of settings profiles that are temporarily applied on top of your existing user settings.", field: Box::new( SettingField { + json_path: Some(""), pick: |settings_content| { settings_content.workspace.use_system_prompts.as_ref() }, @@ -207,6 +218,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Telemetry Diagnostics", description: "Send debug information like crash reports.", field: Box::new(SettingField { + json_path: Some("telemetry.diagnostics"), pick: |settings_content| { settings_content .telemetry @@ -227,6 +239,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Telemetry Metrics", description: "Send anonymized usage data like what languages you're using Zed with.", field: Box::new(SettingField { + json_path: Some("telemetry.metrics"), pick: |settings_content| { settings_content .telemetry @@ -245,6 +258,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Auto Update", description: "Whether or not to automatically check for updates.", field: Box::new(SettingField { + json_path: Some("auto_update"), pick: |settings_content| settings_content.auto_update.as_ref(), write: |settings_content, value| { settings_content.auto_update = value; @@ -265,6 +279,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Theme Mode", description: "Choose a static, fixed theme or dynamically select themes based on appearance and light/dark modes.", field: Box::new(SettingField { + json_path: Some("theme$"), pick: |settings_content| { Some(&dynamic_variants::()[ settings_content @@ -322,6 +337,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Theme Name", description: "The name of your selected theme.", field: Box::new(SettingField { + json_path: Some("theme"), pick: |settings_content| { match settings_content.theme.theme.as_ref() { Some(settings::ThemeSelection::Static(name)) => Some(name), @@ -349,6 +365,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Mode", description: "Choose whether to use the selected light or dark theme or to follow your OS appearance configuration.", field: Box::new(SettingField { + json_path: Some("theme.mode"), pick: |settings_content| { match settings_content.theme.theme.as_ref() { Some(settings::ThemeSelection::Dynamic { mode, ..}) => Some(mode), @@ -374,6 +391,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Light Theme", description: "The theme to use when mode is set to light, or when mode is set to system and it is in light mode.", field: Box::new(SettingField { + json_path: Some("theme.light"), pick: |settings_content| { match settings_content.theme.theme.as_ref() { Some(settings::ThemeSelection::Dynamic { light, ..}) => Some(light), @@ -399,6 +417,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Dark Theme", description: "The theme to use when mode is set to dark, or when mode is set to system and it is in dark mode.", field: Box::new(SettingField { + json_path: Some("theme.dark"), pick: |settings_content| { match settings_content.theme.theme.as_ref() { Some(settings::ThemeSelection::Dynamic { dark, ..}) => Some(dark), @@ -429,6 +448,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Icon Theme", description: "The custom set of icons Zed will associate with files and directories.", field: Box::new(SettingField { + json_path: Some("icon_theme$"), pick: |settings_content| { Some(&dynamic_variants::()[ settings_content @@ -486,6 +506,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Icon Theme Name", description: "The name of your selected icon theme.", field: Box::new(SettingField { + json_path: Some("icon_theme$string"), pick: |settings_content| { match settings_content.theme.icon_theme.as_ref() { Some(settings::IconThemeSelection::Static(name)) => Some(name), @@ -513,6 +534,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Mode", description: "Choose whether to use the selected light or dark icon theme or to follow your OS appearance configuration.", field: Box::new(SettingField { + json_path: Some("icon_theme"), pick: |settings_content| { match settings_content.theme.icon_theme.as_ref() { Some(settings::IconThemeSelection::Dynamic { mode, ..}) => Some(mode), @@ -538,6 +560,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Light Icon Theme", description: "The icon theme to use when mode is set to light, or when mode is set to system and it is in light mode.", field: Box::new(SettingField { + json_path: Some("icon_theme.light"), pick: |settings_content| { match settings_content.theme.icon_theme.as_ref() { Some(settings::IconThemeSelection::Dynamic { light, ..}) => Some(light), @@ -563,6 +586,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Dark Icon Theme", description: "The icon theme to use when mode is set to dark, or when mode is set to system and it is in dark mode.", field: Box::new(SettingField { + json_path: Some("icon_theme.dark"), pick: |settings_content| { match settings_content.theme.icon_theme.as_ref() { Some(settings::IconThemeSelection::Dynamic { dark, ..}) => Some(dark), @@ -592,6 +616,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Family", description: "Font family for editor text.", field: Box::new(SettingField { + json_path: Some("buffer_font_family"), pick: |settings_content| settings_content.theme.buffer_font_family.as_ref(), write: |settings_content, value|{ settings_content.theme.buffer_font_family = value;}, }), @@ -602,6 +627,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Size", description: "Font size for editor text.", field: Box::new(SettingField { + json_path: Some("buffer_font_size"), pick: |settings_content| settings_content.theme.buffer_font_size.as_ref(), write: |settings_content, value|{ settings_content.theme.buffer_font_size = value;}, }), @@ -612,6 +638,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Weight", description: "Font weight for editor text (100-900).", field: Box::new(SettingField { + json_path: Some("buffer_font_weight"), pick: |settings_content| settings_content.theme.buffer_font_weight.as_ref(), write: |settings_content, value|{ settings_content.theme.buffer_font_weight = value;}, }), @@ -624,6 +651,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Line Height", description: "Line height for editor text.", field: Box::new(SettingField { + json_path: Some("buffer_line_height$"), pick: |settings_content| { Some(&dynamic_variants::()[ settings_content @@ -668,6 +696,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Custom Line Height", description: "Custom line height value (must be at least 1.0).", field: Box::new(SettingField { + json_path: Some("buffer_line_height"), pick: |settings_content| { match settings_content.theme.buffer_line_height.as_ref() { Some(settings::BufferLineHeight::Custom(value)) => Some(value), @@ -698,6 +727,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "The OpenType features to enable for rendering in text buffers.", field: Box::new( SettingField { + json_path: Some("buffer_font_features"), pick: |settings_content| { settings_content.theme.buffer_font_features.as_ref() }, @@ -716,6 +746,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "The font fallbacks to use for rendering in text buffers.", field: Box::new( SettingField { + json_path: Some("buffer_font_fallbacks"), pick: |settings_content| { settings_content.theme.buffer_font_fallbacks.as_ref() }, @@ -733,6 +764,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Family", description: "Font family for UI elements.", field: Box::new(SettingField { + json_path: Some("ui_font_family"), pick: |settings_content| settings_content.theme.ui_font_family.as_ref(), write: |settings_content, value|{ settings_content.theme.ui_font_family = value;}, }), @@ -743,6 +775,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Size", description: "Font size for UI elements.", field: Box::new(SettingField { + json_path: Some("ui_font_size"), pick: |settings_content| settings_content.theme.ui_font_size.as_ref(), write: |settings_content, value|{ settings_content.theme.ui_font_size = value;}, }), @@ -753,6 +786,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Weight", description: "Font weight for UI elements (100-900).", field: Box::new(SettingField { + json_path: Some("ui_font_weight"), pick: |settings_content| settings_content.theme.ui_font_weight.as_ref(), write: |settings_content, value|{ settings_content.theme.ui_font_weight = value;}, }), @@ -765,6 +799,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "The Opentype features to enable for rendering in UI elements.", field: Box::new( SettingField { + json_path: Some("ui_font_features"), pick: |settings_content| { settings_content.theme.ui_font_features.as_ref() }, @@ -783,6 +818,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "The font fallbacks to use for rendering in the UI.", field: Box::new( SettingField { + json_path: Some("ui_font_fallbacks"), pick: |settings_content| { settings_content.theme.ui_font_fallbacks.as_ref() }, @@ -800,6 +836,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "UI Font Size", description: "Font size for agent response text in the agent panel. Falls back to the regular UI font size.", field: Box::new(SettingField { + json_path: Some("agent_ui_font_size"), pick: |settings_content| { settings_content .theme @@ -816,6 +853,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Buffer Font Size", description: "Font size for user messages text in the agent panel.", field: Box::new(SettingField { + json_path: Some("agent_buffer_font_size"), pick: |settings_content| { settings_content .theme @@ -836,6 +874,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Multi Cursor Modifier", description: "Modifier key for adding multiple cursors.", field: Box::new(SettingField { + json_path: Some("multi_cursor_modifier"), pick: |settings_content| { settings_content.editor.multi_cursor_modifier.as_ref() }, @@ -851,6 +890,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Cursor Blink", description: "Whether the cursor blinks in the editor.", field: Box::new(SettingField { + json_path: Some("cursor_blink"), pick: |settings_content| settings_content.editor.cursor_blink.as_ref(), write: |settings_content, value|{ settings_content.editor.cursor_blink = value;}, }), @@ -861,6 +901,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Cursor Shape", description: "Cursor shape for the editor.", field: Box::new(SettingField { + json_path: Some("cursor_shape"), pick: |settings_content| settings_content.editor.cursor_shape.as_ref(), write: |settings_content, value|{ settings_content.editor.cursor_shape = value;}, }), @@ -871,6 +912,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Hide Mouse", description: "When to hide the mouse cursor.", field: Box::new(SettingField { + json_path: Some("hide_mouse"), pick: |settings_content| settings_content.editor.hide_mouse.as_ref(), write: |settings_content, value|{ settings_content.editor.hide_mouse = value;}, }), @@ -882,6 +924,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Unnecessary Code Fade", description: "How much to fade out unused code (0.0 - 0.9).", field: Box::new(SettingField { + json_path: Some("unnecessary_code_fade"), pick: |settings_content| { settings_content.theme.unnecessary_code_fade.as_ref() }, @@ -897,6 +940,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Current Line Highlight", description: "How to highlight the current line.", field: Box::new(SettingField { + json_path: Some("current_line_highlight"), pick: |settings_content| { settings_content.editor.current_line_highlight.as_ref() }, @@ -912,6 +956,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Selection Highlight", description: "Highlight all occurrences of selected text.", field: Box::new(SettingField { + json_path: Some("selection_highlight"), pick: |settings_content| { settings_content.editor.selection_highlight.as_ref() }, @@ -927,6 +972,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Rounded Selection", description: "Whether the text selection should have rounded corners.", field: Box::new(SettingField { + json_path: Some("rounded_selection"), pick: |settings_content| settings_content.editor.rounded_selection.as_ref(), write: |settings_content, value|{ settings_content.editor.rounded_selection = value;}, }), @@ -937,6 +983,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Minimum Contrast For Highlights", description: "The minimum APCA perceptual contrast to maintain when rendering text over highlight backgrounds.", field: Box::new(SettingField { + json_path: Some("minimum_contrast_for_highlights"), pick: |settings_content| { settings_content .editor @@ -956,6 +1003,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Wrap Guides", description: "Show wrap guides (vertical rulers).", field: Box::new(SettingField { + json_path: Some("show_wrap_guides"), pick: |settings_content| { settings_content .project @@ -982,6 +1030,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Character counts at which to show wrap guides.", field: Box::new( SettingField { + json_path: Some("wrap_guides"), pick: |settings_content| { settings_content .project @@ -992,7 +1041,6 @@ pub(crate) fn settings_data(cx: &App) -> Vec { }, write: |settings_content, value| { settings_content.project.all_languages.defaults.wrap_guides = value; - }, } .unimplemented(), @@ -1010,6 +1058,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Base Keymap", description: "The name of a base set of key bindings to use.", field: Box::new(SettingField { + json_path: Some("base_keymap"), pick: |settings_content| settings_content.base_keymap.as_ref(), write: |settings_content, value| { settings_content.base_keymap = value; @@ -1028,6 +1077,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Vim Mode", description: "Enable Vim mode and key bindings.", field: Box::new(SettingField { + json_path: Some("vim_mode"), pick: |settings_content| settings_content.vim_mode.as_ref(), write: |settings_content, value| { settings_content.vim_mode = value; @@ -1040,6 +1090,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Helix Mode", description: "Enable Helix mode and key bindings.", field: Box::new(SettingField { + json_path: Some("helix_mode"), pick: |settings_content| settings_content.helix_mode.as_ref(), write: |settings_content, value| { settings_content.helix_mode = value; @@ -1061,6 +1112,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Auto Save Mode", description: "When to auto save buffer changes.", field: Box::new(SettingField { + json_path: Some("autosave$"), pick: |settings_content| { Some(&dynamic_variants::()[ settings_content @@ -1110,6 +1162,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Delay (milliseconds)", description: "Save after inactivity period (in milliseconds).", field: Box::new(SettingField { + json_path: Some("autosave.after_delay.milliseconds"), pick: |settings_content| { match settings_content.workspace.autosave.as_ref() { Some(settings::AutosaveSetting::AfterDelay { milliseconds }) => Some(milliseconds), @@ -1141,6 +1194,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Double Click In Multibuffer", description: "What to do when multibuffer is double-clicked in some of its excerpts.", field: Box::new(SettingField { + json_path: Some("double_click_in_multibuffer"), pick: |settings_content| { settings_content.editor.double_click_in_multibuffer.as_ref() }, @@ -1155,6 +1209,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Expand Excerpt Lines", description: "How many lines to expand the multibuffer excerpts by default.", field: Box::new(SettingField { + json_path: Some("expand_excerpt_lines"), pick: |settings_content| { settings_content.editor.expand_excerpt_lines.as_ref() }, @@ -1169,6 +1224,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Excerpt Context Lines", description: "How many lines of context to provide in multibuffer excerpts by default.", field: Box::new(SettingField { + json_path: Some("excerpt_context_lines"), pick: |settings_content| { settings_content.editor.excerpt_context_lines.as_ref() }, @@ -1183,6 +1239,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Expand Outlines With Depth", description: "Default depth to expand outline items in the current file.", field: Box::new(SettingField { + json_path: Some("outline_panel.expand_outlines_with_depth"), pick: |settings_content| { settings_content .outline_panel @@ -1206,6 +1263,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Scroll Beyond Last Line", description: "Whether the editor will scroll beyond the last line.", field: Box::new(SettingField { + json_path: Some("scroll_beyond_last_line"), pick: |settings_content| { settings_content.editor.scroll_beyond_last_line.as_ref() }, @@ -1220,6 +1278,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Vertical Scroll Margin", description: "The number of lines to keep above/below the cursor when auto-scrolling.", field: Box::new(SettingField { + json_path: Some("vertical_scroll_margin"), pick: |settings_content| { settings_content.editor.vertical_scroll_margin.as_ref() }, @@ -1234,6 +1293,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Horizontal Scroll Margin", description: "The number of characters to keep on either side when scrolling with the mouse.", field: Box::new(SettingField { + json_path: Some("horizontal_scroll_margin"), pick: |settings_content| { settings_content.editor.horizontal_scroll_margin.as_ref() }, @@ -1248,6 +1308,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Scroll Sensitivity", description: "Scroll sensitivity multiplier for both horizontal and vertical scrolling.", field: Box::new(SettingField { + json_path: Some("scroll_sensitivity"), pick: |settings_content| { settings_content.editor.scroll_sensitivity.as_ref() }, @@ -1262,6 +1323,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Fast Scroll Sensitivity", description: "Fast scroll sensitivity multiplier for both horizontal and vertical scrolling.", field: Box::new(SettingField { + json_path: Some("fast_scroll_sensitivity"), pick: |settings_content| { settings_content.editor.fast_scroll_sensitivity.as_ref() }, @@ -1276,6 +1338,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Autoscroll On Clicks", description: "Whether to scroll when clicking near the edge of the visible text area.", field: Box::new(SettingField { + json_path: Some("autoscroll_on_clicks"), pick: |settings_content| { settings_content.editor.autoscroll_on_clicks.as_ref() }, @@ -1291,6 +1354,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Auto Signature Help", description: "Automatically show a signature help pop-up.", field: Box::new(SettingField { + json_path: Some("auto_signature_help"), pick: |settings_content| { settings_content.editor.auto_signature_help.as_ref() }, @@ -1305,6 +1369,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Signature Help After Edits", description: "Show the signature help pop-up after completions or bracket pairs are inserted.", field: Box::new(SettingField { + json_path: Some("show_signature_help_after_edits"), pick: |settings_content| { settings_content .editor @@ -1322,6 +1387,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Snippet Sort Order", description: "Determines how snippets are sorted relative to other completion items.", field: Box::new(SettingField { + json_path: Some("snippet_sort_order"), pick: |settings_content| { settings_content.editor.snippet_sort_order.as_ref() }, @@ -1337,6 +1403,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Enabled", description: "Show the informational hover box when moving the mouse over symbols in the editor.", field: Box::new(SettingField { + json_path: Some("hover_popover_enabled"), pick: |settings_content| { settings_content.editor.hover_popover_enabled.as_ref() }, @@ -1352,6 +1419,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Delay", description: "Time to wait in milliseconds before showing the informational hover box.", field: Box::new(SettingField { + json_path: Some("hover_popover_enabled"), pick: |settings_content| { settings_content.editor.hover_popover_delay.as_ref() }, @@ -1367,6 +1435,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Enabled", description: "Enable drag and drop selection.", field: Box::new(SettingField { + json_path: Some("drag_and_drop_selection.enabled"), pick: |settings_content| { settings_content .editor @@ -1389,6 +1458,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Delay", description: "Delay in milliseconds before drag and drop selection starts.", field: Box::new(SettingField { + json_path: Some("drag_and_drop_selection.delay"), pick: |settings_content| { settings_content .editor @@ -1412,6 +1482,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Line Numbers", description: "Show line numbers in the gutter.", field: Box::new(SettingField { + json_path: Some("gutter.line_numbers"), pick: |settings_content| { settings_content .editor @@ -1434,6 +1505,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Relative Line Numbers", description: "Whether the line numbers in the editor's gutter are relative or not.", field: Box::new(SettingField { + json_path: Some("relative_line_numbers"), pick: |settings_content| { settings_content.editor.relative_line_numbers.as_ref() }, @@ -1448,6 +1520,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Runnables", description: "Show runnable buttons in the gutter.", field: Box::new(SettingField { + json_path: Some("gutter.runnables"), pick: |settings_content| { settings_content .editor @@ -1470,6 +1543,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Breakpoints", description: "Show breakpoints in the gutter.", field: Box::new(SettingField { + json_path: Some("gutter.breakpoints"), pick: |settings_content| { settings_content .editor @@ -1492,6 +1566,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Folds", description: "Show code folding controls in the gutter.", field: Box::new(SettingField { + json_path: Some("gutter.folds"), pick: |settings_content| { settings_content .editor @@ -1511,6 +1586,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Min Line Number Digits", description: "Minimum number of characters to reserve space for in the gutter.", field: Box::new(SettingField { + json_path: Some("gutter.min_line_number_digits"), pick: |settings_content| { settings_content .editor @@ -1533,6 +1609,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Inline Code Actions", description: "Show code action button at start of buffer line.", field: Box::new(SettingField { + json_path: Some("inline_code_actions"), pick: |settings_content| { settings_content.editor.inline_code_actions.as_ref() }, @@ -1548,6 +1625,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show", description: "When to show the scrollbar in the editor.", field: Box::new(SettingField { + json_path: Some("scrollbar"), pick: |settings_content| { settings_content.editor.scrollbar.as_ref()?.show.as_ref() }, @@ -1566,6 +1644,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Cursors", description: "Show cursor positions in the scrollbar.", field: Box::new(SettingField { + json_path: Some("scrollbar.cursors"), pick: |settings_content| { settings_content.editor.scrollbar.as_ref()?.cursors.as_ref() }, @@ -1584,6 +1663,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Git Diff", description: "Show Git diff indicators in the scrollbar.", field: Box::new(SettingField { + json_path: Some("scrollbar.git_diff"), pick: |settings_content| { settings_content .editor @@ -1607,6 +1687,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Search Results", description: "Show buffer search result indicators in the scrollbar.", field: Box::new(SettingField { + json_path: Some("scrollbar.search_results"), pick: |settings_content| { settings_content .editor @@ -1630,6 +1711,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Selected Text", description: "Show selected text occurrences in the scrollbar.", field: Box::new(SettingField { + json_path: Some("scrollbar.selected_text"), pick: |settings_content| { settings_content .editor @@ -1653,6 +1735,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Selected Symbol", description: "Show selected symbol occurrences in the scrollbar.", field: Box::new(SettingField { + json_path: Some("scrollbar.selected_symbol"), pick: |settings_content| { settings_content .editor @@ -1676,6 +1759,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Diagnostics", description: "Which diagnostic indicators to show in the scrollbar.", field: Box::new(SettingField { + json_path: Some("scrollbar.diagnostics"), pick: |settings_content| { settings_content .editor @@ -1699,6 +1783,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Horizontal Scrollbar", description: "When false, forcefully disables the horizontal scrollbar.", field: Box::new(SettingField { + json_path: Some("scrollbar.axes.horizontal"), pick: |settings_content| { settings_content .editor @@ -1726,6 +1811,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Vertical Scrollbar", description: "When false, forcefully disables the vertical scrollbar.", field: Box::new(SettingField { + json_path: Some("scrollbar.axes.vertical"), pick: |settings_content| { settings_content .editor @@ -1754,6 +1840,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show", description: "When to show the minimap in the editor.", field: Box::new(SettingField { + json_path: Some("minimap.show"), pick: |settings_content| { settings_content.editor.minimap.as_ref()?.show.as_ref() }, @@ -1769,6 +1856,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Display In", description: "Where to show the minimap in the editor.", field: Box::new(SettingField { + json_path: Some("minimap.display_in"), pick: |settings_content| { settings_content .editor @@ -1792,6 +1880,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Thumb", description: "When to show the minimap thumb.", field: Box::new(SettingField { + json_path: Some("minimap.thumb"), pick: |settings_content| { settings_content.editor.minimap.as_ref()?.thumb.as_ref() }, @@ -1810,6 +1899,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Thumb Border", description: "Border style for the minimap's scrollbar thumb.", field: Box::new(SettingField { + json_path: Some("minimap.thumb_border"), pick: |settings_content| { settings_content .editor @@ -1833,6 +1923,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Current Line Highlight", description: "How to highlight the current line in the minimap.", field: Box::new(SettingField { + json_path: Some("minimap.current_line_highlight"), pick: |settings_content| { settings_content .editor @@ -1856,6 +1947,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Max Width Columns", description: "Maximum number of columns to display in the minimap.", field: Box::new(SettingField { + json_path: Some("minimap.max_width_columns"), pick: |settings_content| { settings_content .editor @@ -1880,6 +1972,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Breadcrumbs", description: "Show breadcrumbs.", field: Box::new(SettingField { + json_path: Some("toolbar.breadcrumbs"), pick: |settings_content| { settings_content .editor @@ -1903,6 +1996,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Quick Actions", description: "Show quick action buttons (e.g., search, selection, editor controls, etc.).", field: Box::new(SettingField { + json_path: Some("toolbar.quick_actions"), pick: |settings_content| { settings_content .editor @@ -1926,6 +2020,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Selections Menu", description: "Show the selections menu in the editor toolbar.", field: Box::new(SettingField { + json_path: Some("toolbar.selections_menu"), pick: |settings_content| { settings_content .editor @@ -1949,6 +2044,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Agent Review", description: "Show agent review buttons in the editor toolbar.", field: Box::new(SettingField { + json_path: Some("toolbar.agent_review"), pick: |settings_content| { settings_content .editor @@ -1972,6 +2068,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Code Actions", description: "Show code action buttons in the editor toolbar.", field: Box::new(SettingField { + json_path: Some("toolbar.code_actions"), pick: |settings_content| { settings_content .editor @@ -2008,6 +2105,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "A mapping from languages to files and file extensions that should be treated as that language.", field: Box::new( SettingField { + json_path: Some("file_types"), pick: |settings_content| { settings_content.project.all_languages.file_types.as_ref() }, @@ -2029,6 +2127,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Max Severity", description: "Which level to use to filter out diagnostics displayed in the editor.", field: Box::new(SettingField { + json_path: Some("diagnostics_max_severity"), pick: |settings_content| settings_content.editor.diagnostics_max_severity.as_ref(), write: |settings_content, value| { settings_content.editor.diagnostics_max_severity = value; @@ -2042,6 +2141,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Include Warnings", description: "Whether to show warnings or not by default.", field: Box::new(SettingField { + json_path: Some("diagnostics.include_warnings"), pick: |settings_content| { settings_content.diagnostics.as_ref()?.include_warnings.as_ref() }, @@ -2062,6 +2162,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Enabled", description: "Whether to show diagnostics inline or not.", field: Box::new(SettingField { + json_path: Some("diagnostics.inline.enabled"), pick: |settings_content| { settings_content.diagnostics.as_ref()?.inline.as_ref()?.enabled.as_ref() }, @@ -2083,6 +2184,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Update Debounce", description: "The delay in milliseconds to show inline diagnostics after the last diagnostic update.", field: Box::new(SettingField { + json_path: Some("diagnostics.inline.update_debounce_ms"), pick: |settings_content| { settings_content.diagnostics.as_ref()?.inline.as_ref()?.update_debounce_ms.as_ref() }, @@ -2104,6 +2206,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Padding", description: "The amount of padding between the end of the source line and the start of the inline diagnostic.", field: Box::new(SettingField { + json_path: Some("diagnostics.inline.padding"), pick: |settings_content| { settings_content.diagnostics.as_ref()?.inline.as_ref()?.padding.as_ref() }, @@ -2125,6 +2228,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Minimum Column", description: "The minimum column at which to display inline diagnostics.", field: Box::new(SettingField { + json_path: Some("diagnostics.inline.min_column"), pick: |settings_content| { settings_content.diagnostics.as_ref()?.inline.as_ref()?.min_column.as_ref() }, @@ -2147,6 +2251,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Enabled", description: "Whether to pull for language server-powered diagnostics or not.", field: Box::new(SettingField { + json_path: Some("diagnostics.lsp_pull_diagnostics.enabled"), pick: |settings_content| { settings_content.diagnostics.as_ref()?.lsp_pull_diagnostics.as_ref()?.enabled.as_ref() }, @@ -2169,6 +2274,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Debounce", description: "Minimum time to wait before pulling diagnostics from the language server(s).", field: Box::new(SettingField { + json_path: Some("diagnostics.lsp_pull_diagnostics.debounce_ms"), pick: |settings_content| { settings_content.diagnostics.as_ref()?.lsp_pull_diagnostics.as_ref()?.debounce_ms.as_ref() }, @@ -2191,10 +2297,10 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Debounce", description: "The debounce delay before querying highlights from the language.", field: Box::new(SettingField { + json_path: Some("lsp_highlight_debounce"), pick: |settings_content| settings_content.editor.lsp_highlight_debounce.as_ref(), write: |settings_content, value| { settings_content.editor.lsp_highlight_debounce = value; - }, }), metadata: None, @@ -2234,6 +2340,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Whole Word", description: "Search for whole words by default.", field: Box::new(SettingField { + json_path: Some("search.whole_word"), pick: |settings_content| { settings_content.editor.search.as_ref()?.whole_word.as_ref() }, @@ -2252,6 +2359,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Case Sensitive", description: "Search case-sensitively by default.", field: Box::new(SettingField { + json_path: Some("search.case_sensitive"), pick: |settings_content| { settings_content .editor @@ -2275,6 +2383,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Use Smartcase Search", description: "Whether to automatically enable case-sensitive search based on the search query.", field: Box::new(SettingField { + json_path: Some("use_smartcase_search"), pick: |settings_content| { settings_content.editor.use_smartcase_search.as_ref() }, @@ -2289,6 +2398,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Include Ignored", description: "Include ignored files in search results by default.", field: Box::new(SettingField { + json_path: Some("search.include_ignored"), pick: |settings_content| { settings_content .editor @@ -2312,6 +2422,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Regex", description: "Use regex search by default.", field: Box::new(SettingField { + json_path: Some("search.regex"), pick: |settings_content| { settings_content.editor.search.as_ref()?.regex.as_ref() }, @@ -2326,6 +2437,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Search Wrap", description: "Whether the editor search results will loop.", field: Box::new(SettingField { + json_path: Some("search_wrap"), pick: |settings_content| settings_content.editor.search_wrap.as_ref(), write: |settings_content, value| { settings_content.editor.search_wrap = value; @@ -2338,6 +2450,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { 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 { + json_path: Some("seed_search_query_from_cursor"), pick: |settings_content| { settings_content .editor @@ -2358,6 +2471,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Use gitignored files when searching.", field: Box::new( SettingField { + json_path: Some("file_finder.include_ignored"), pick: |settings_content| { settings_content .file_finder @@ -2380,6 +2494,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "File Icons", description: "Show file icons in the file finder.", field: Box::new(SettingField { + json_path: Some("file_finder.file_icons"), pick: |settings_content| { settings_content.file_finder.as_ref()?.file_icons.as_ref() }, @@ -2397,6 +2512,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { 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 { + json_path: Some("file_finder.modal_max_width"), pick: |settings_content| { settings_content .file_finder @@ -2418,6 +2534,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { 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 { + json_path: Some("file_finder.skip_focus_for_active_in_search"), pick: |settings_content| { settings_content .file_finder @@ -2439,6 +2556,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Git Status", description: "Show the Git status in the file finder.", field: Box::new(SettingField { + json_path: Some("file_finder.git_status"), pick: |settings_content| { settings_content.file_finder.as_ref()?.git_status.as_ref() }, @@ -2458,6 +2576,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Files or globs of files that will be excluded by Zed entirely. They will be skipped during file scans, file searches, and not be displayed in the project file tree. Takes precedence over \"File Scan Inclusions\"", field: Box::new( SettingField { + json_path: Some("file_scan_exclusions"), pick: |settings_content| { settings_content .project @@ -2479,15 +2598,16 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Files or globs of files that will be included by Zed, even when ignored by git. This is useful for files that are not tracked by git, but are still important to your project. Note that globs that are overly broad can slow down Zed's file scanning. \"File Scan Exclusions\" takes precedence over these inclusions", field: Box::new( SettingField { + json_path: Some("file_scan_inclusions"), pick: |settings_content| { settings_content .project .worktree - .file_scan_exclusions + .file_scan_inclusions .as_ref() }, write: |settings_content, value| { - settings_content.project.worktree.file_scan_exclusions = value; + settings_content.project.worktree.file_scan_inclusions = value; }, } .unimplemented(), @@ -2499,6 +2619,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Restore File State", description: "Restore previous file state when reopening.", field: Box::new(SettingField { + json_path: Some("restore_on_file_reopen"), pick: |settings_content| { settings_content.workspace.restore_on_file_reopen.as_ref() }, @@ -2513,6 +2634,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Close on File Delete", description: "Automatically close files that have been deleted.", field: Box::new(SettingField { + json_path: Some("close_on_file_delete"), pick: |settings_content| { settings_content.workspace.close_on_file_delete.as_ref() }, @@ -2533,6 +2655,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Project Panel Button", description: "Show the project panel button in the status bar.", field: Box::new(SettingField { + json_path: Some("project_panel.button"), pick: |settings_content| { settings_content.project_panel.as_ref()?.button.as_ref() }, @@ -2550,6 +2673,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Active Language Button", description: "Show the active language button in the status bar.", field: Box::new(SettingField { + json_path: Some("status_bar.active_language_button"), pick: |settings_content| { settings_content .status_bar @@ -2571,6 +2695,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Cursor Position Button", description: "Show the cursor position button in the status bar.", field: Box::new(SettingField { + json_path: Some("status_bar.cursor_position_button"), pick: |settings_content| { settings_content .status_bar @@ -2592,6 +2717,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Terminal Button", description: "Show the terminal button in the status bar.", field: Box::new(SettingField { + json_path: Some("terminal.button"), pick: |settings_content| { settings_content.terminal.as_ref()?.button.as_ref() }, @@ -2606,6 +2732,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Diagnostics Button", description: "Show the project diagnostics button in the status bar.", field: Box::new(SettingField { + json_path: Some("diagnostics.button"), pick: |settings_content| { settings_content.diagnostics.as_ref()?.button.as_ref() }, @@ -2620,6 +2747,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Project Search Button", description: "Show the project search button in the status bar.", field: Box::new(SettingField { + json_path: Some("search.button"), pick: |settings_content| { settings_content.editor.search.as_ref()?.button.as_ref() }, @@ -2638,6 +2766,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Debugger Button", description: "Show the debugger button in the status bar.", field: Box::new(SettingField { + json_path: Some("debugger.button"), pick: |settings_content| { settings_content.debugger.as_ref()?.button.as_ref() }, @@ -2653,6 +2782,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Branch Icon", description: "Show the branch icon beside branch switcher in the titlebar.", field: Box::new(SettingField { + json_path: Some("title_bar.show_branch_icon"), pick: |settings_content| { settings_content .title_bar @@ -2674,6 +2804,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Branch Name", description: "Show the branch name button in the titlebar.", field: Box::new(SettingField { + json_path: Some("title_bar.show_branch_name"), pick: |settings_content| { settings_content .title_bar @@ -2695,6 +2826,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Project Items", description: "Show the project host and name in the titlebar.", field: Box::new(SettingField { + json_path: Some("title_bar.show_project_items"), pick: |settings_content| { settings_content .title_bar @@ -2716,6 +2848,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Onboarding Banner", description: "Show banners announcing new features in the titlebar.", field: Box::new(SettingField { + json_path: Some("title_bar.show_onboarding_banner"), pick: |settings_content| { settings_content .title_bar @@ -2737,6 +2870,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show User Picture", description: "Show user picture in the titlebar.", field: Box::new(SettingField { + json_path: Some("title_bar.show_user_picture"), pick: |settings_content| { settings_content .title_bar @@ -2758,6 +2892,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Sign In", description: "Show the sign in button in the titlebar.", field: Box::new(SettingField { + json_path: Some("title_bar.show_sign_in"), pick: |settings_content| { settings_content.title_bar.as_ref()?.show_sign_in.as_ref() }, @@ -2775,6 +2910,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Menus", description: "Show the menus in the titlebar.", field: Box::new(SettingField { + json_path: Some("title_bar.show_menus"), pick: |settings_content| { settings_content.title_bar.as_ref()?.show_menus.as_ref() }, @@ -2793,6 +2929,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Tab Bar", description: "Show the tab bar in the editor.", field: Box::new(SettingField { + json_path: Some("tab_bar.show"), pick: |settings_content| settings_content.tab_bar.as_ref()?.show.as_ref(), write: |settings_content, value| { settings_content.tab_bar.get_or_insert_default().show = value; @@ -2805,6 +2942,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Git Status In Tabs", description: "Show the Git file status on a tab item.", field: Box::new(SettingField { + json_path: Some("tabs.git_status"), pick: |settings_content| { settings_content.tabs.as_ref()?.git_status.as_ref() }, @@ -2819,6 +2957,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show File Icons In Tabs", description: "Show the file icon for a tab.", field: Box::new(SettingField { + json_path: Some("tabs.file_icons"), pick: |settings_content| { settings_content.tabs.as_ref()?.file_icons.as_ref() }, @@ -2833,6 +2972,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Tab Close Position", description: "Position of the close button in a tab.", field: Box::new(SettingField { + json_path: Some("tabs.close_position"), pick: |settings_content| { settings_content.tabs.as_ref()?.close_position.as_ref() }, @@ -2851,6 +2991,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { // is complex, so I'm going to come back to this later field: Box::new( SettingField { + json_path: Some("max_tabs"), pick: |settings_content| settings_content.workspace.max_tabs.as_ref(), write: |settings_content, value| { settings_content.workspace.max_tabs = value; @@ -2864,6 +3005,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Navigation History Buttons", description: "Show the navigation history buttons in the tab bar.", field: Box::new(SettingField { + json_path: Some("tab_bar.show_nav_history_buttons"), pick: |settings_content| { settings_content .tab_bar @@ -2886,6 +3028,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Activate On Close", description: "What to do after closing the current tab.", field: Box::new(SettingField { + json_path: Some("tabs.activate_on_close"), pick: |settings_content| { settings_content.tabs.as_ref()?.activate_on_close.as_ref() }, @@ -2903,6 +3046,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Tab Show Diagnostics", description: "Which files containing diagnostic errors/warnings to mark in the tabs.", field: Box::new(SettingField { + json_path: Some("tabs.show_diagnostics"), pick: |settings_content| { settings_content.tabs.as_ref()?.show_diagnostics.as_ref() }, @@ -2920,6 +3064,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Close Button", description: "Controls the appearance behavior of the tab's close button.", field: Box::new(SettingField { + json_path: Some("tabs.show_close_button"), pick: |settings_content| { settings_content.tabs.as_ref()?.show_close_button.as_ref() }, @@ -2938,6 +3083,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Preview Tabs Enabled", description: "Show opened editors as Preview tabs.", field: Box::new(SettingField { + json_path: Some("preview_tabs.enabled"), pick: |settings_content| { settings_content.preview_tabs.as_ref()?.enabled.as_ref() }, @@ -2955,6 +3101,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Enable Preview From File Finder", description: "Whether to open tabs in Preview mode when selected from the file finder.", field: Box::new(SettingField { + json_path: Some("preview_tabs.enable_preview_from_file_finder"), pick: |settings_content| { settings_content .preview_tabs @@ -2976,6 +3123,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { 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 { + json_path: Some("preview_tabs.enable_preview_from_code_navigation"), pick: |settings_content| { settings_content .preview_tabs @@ -2998,6 +3146,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Bottom Dock Layout", description: "Layout mode for the bottom dock.", field: Box::new(SettingField { + json_path: Some("bottom_dock_layout"), pick: |settings_content| { settings_content.workspace.bottom_dock_layout.as_ref() }, @@ -3013,6 +3162,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Centered Layout Left Padding", description: "Left padding for centered layout.", field: Box::new(SettingField { + json_path: Some("centered_layout.left_padding"), pick: |settings_content| { settings_content .workspace @@ -3036,6 +3186,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Centered Layout Right Padding", description: "Right padding for centered layout.", field: Box::new(SettingField { + json_path: Some("centered_layout.right_padding"), pick: |settings_content| { settings_content .workspace @@ -3060,6 +3211,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Use System Window Tabs", description: "(macOS only) whether to allow Windows to tab together.", field: Box::new(SettingField { + json_path: Some("use_system_window_tabs"), pick: |settings_content| { settings_content.workspace.use_system_window_tabs.as_ref() }, @@ -3075,6 +3227,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Inactive Opacity", description: "Opacity of inactive panels (0.0 - 1.0).", field: Box::new(SettingField { + json_path: Some("active_pane_modifiers.inactive_opacity"), pick: |settings_content| { settings_content .workspace @@ -3098,6 +3251,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Border Size", description: "Size of the border surrounding the active pane.", field: Box::new(SettingField { + json_path: Some("active_pane_modifiers.border_size"), pick: |settings_content| { settings_content .workspace @@ -3121,6 +3275,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Zoomed Padding", description: "Show padding for zoomed panes.", field: Box::new(SettingField { + json_path: Some("zoomed_padding"), pick: |settings_content| settings_content.workspace.zoomed_padding.as_ref(), write: |settings_content, value| { settings_content.workspace.zoomed_padding = value; @@ -3134,6 +3289,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Vertical Split Direction", description: "Direction to split vertically.", field: Box::new(SettingField { + json_path: Some("pane_split_direction_vertical"), pick: |settings_content| { settings_content .workspace @@ -3151,6 +3307,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Horizontal Split Direction", description: "Direction to split horizontally.", field: Box::new(SettingField { + json_path: Some("pane_split_direction_horizontal"), pick: |settings_content| { settings_content .workspace @@ -3174,6 +3331,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Project Panel Dock", description: "Where to dock the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.dock"), pick: |settings_content| { settings_content.project_panel.as_ref()?.dock.as_ref() }, @@ -3188,6 +3346,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Project Panel Default Width", description: "Default width of the project panel in pixels.", field: Box::new(SettingField { + json_path: Some("project_panel.default_width"), pick: |settings_content| { settings_content .project_panel @@ -3209,6 +3368,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Hide .gitignore", description: "Whether to hide the gitignore entries in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.hide_gitignore"), pick: |settings_content| { settings_content .project_panel @@ -3230,6 +3390,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Entry Spacing", description: "Spacing between worktree entries in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.entry_spacing"), pick: |settings_content| { settings_content .project_panel @@ -3251,6 +3412,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "File Icons", description: "Show file icons in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.file_icons"), pick: |settings_content| { settings_content.project_panel.as_ref()?.file_icons.as_ref() }, @@ -3268,6 +3430,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Folder Icons", description: "Whether to show folder icons or chevrons for directories in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.folder_icons"), pick: |settings_content| { settings_content .project_panel @@ -3289,6 +3452,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Git Status", description: "Show the Git status in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.git_status"), pick: |settings_content| { settings_content.project_panel.as_ref()?.git_status.as_ref() }, @@ -3306,6 +3470,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Indent Size", description: "Amount of indentation for nested items.", field: Box::new(SettingField { + json_path: Some("project_panel.indent_size"), pick: |settings_content| { settings_content .project_panel @@ -3327,6 +3492,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Auto Reveal Entries", description: "Whether to reveal entries in the project panel automatically when a corresponding project entry becomes active.", field: Box::new(SettingField { + json_path: Some("project_panel.auto_reveal_entries"), pick: |settings_content| { settings_content .project_panel @@ -3348,6 +3514,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Starts Open", description: "Whether the project panel should open on startup.", field: Box::new(SettingField { + json_path: Some("project_panel.starts_open"), pick: |settings_content| { settings_content .project_panel @@ -3369,6 +3536,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { 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 { + json_path: Some("project_panel.auto_fold_dirs"), pick: |settings_content| { settings_content .project_panel @@ -3390,6 +3558,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Scrollbar", description: "Show the scrollbar in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.scrollbar.show"), pick: |settings_content| { show_scrollbar_or_editor(settings_content, |settings_content| { settings_content @@ -3417,6 +3586,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Diagnostics", description: "Which files containing diagnostic errors/warnings to mark in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.show_diagnostics"), pick: |settings_content| { settings_content .project_panel @@ -3438,6 +3608,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Sticky Scroll", description: "Whether to stick parent directories at top of the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.sticky_scroll"), pick: |settings_content| { settings_content .project_panel @@ -3461,6 +3632,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Show indent guides in the project panel.", field: Box::new( SettingField { + json_path: Some("project_panel.indent_guides.show"), pick: |settings_content| { settings_content .project_panel @@ -3486,6 +3658,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Drag and Drop", description: "Whether to enable drag-and-drop operations in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.drag_and_drop"), pick: |settings_content| { settings_content .project_panel @@ -3507,6 +3680,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Hide Root", description: "Whether to hide the root entry when only one folder is open in the window.", field: Box::new(SettingField { + json_path: Some("project_panel.drag_and_drop"), pick: |settings_content| { settings_content.project_panel.as_ref()?.hide_root.as_ref() }, @@ -3524,6 +3698,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Hide Hidden", description: "Whether to hide the hidden entries in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.hide_hidden"), pick: |settings_content| { settings_content .project_panel @@ -3545,6 +3720,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Open File on Paste", description: "Whether to automatically open files when pasting them in the project panel.", field: Box::new(SettingField { + json_path: Some("project_panel.open_file_on_paste"), pick: |settings_content| { settings_content .project_panel @@ -3567,6 +3743,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Terminal Dock", description: "Where to dock the terminal panel.", field: Box::new(SettingField { + json_path: Some("terminal.dock"), pick: |settings_content| settings_content.terminal.as_ref()?.dock.as_ref(), write: |settings_content, value| { settings_content.terminal.get_or_insert_default().dock = value; @@ -3580,6 +3757,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Outline Panel Button", description: "Show the outline panel button in the status bar.", field: Box::new(SettingField { + json_path: Some("outline_panel.button"), pick: |settings_content| { settings_content.outline_panel.as_ref()?.button.as_ref() }, @@ -3597,6 +3775,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Outline Panel Dock", description: "Where to dock the outline panel.", field: Box::new(SettingField { + json_path: Some("outline_panel.dock"), pick: |settings_content| { settings_content.outline_panel.as_ref()?.dock.as_ref() }, @@ -3611,6 +3790,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Outline Panel Default Width", description: "Default width of the outline panel in pixels.", field: Box::new(SettingField { + json_path: Some("outline_panel.default_width"), pick: |settings_content| { settings_content .outline_panel @@ -3632,6 +3812,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "File Icons", description: "Show file icons in the outline panel.", field: Box::new(SettingField { + json_path: Some("outline_panel.file_icons"), pick: |settings_content| { settings_content.outline_panel.as_ref()?.file_icons.as_ref() }, @@ -3649,6 +3830,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Folder Icons", description: "Whether to show folder icons or chevrons for directories in the outline panel.", field: Box::new(SettingField { + json_path: Some("outline_panel.folder_icons"), pick: |settings_content| { settings_content .outline_panel @@ -3670,6 +3852,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Git Status", description: "Show the Git status in the outline panel.", field: Box::new(SettingField { + json_path: Some("outline_panel.git_status"), pick: |settings_content| { settings_content.outline_panel.as_ref()?.git_status.as_ref() }, @@ -3687,6 +3870,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Indent Size", description: "Amount of indentation for nested items.", field: Box::new(SettingField { + json_path: Some("outline_panel.indent_size"), pick: |settings_content| { settings_content .outline_panel @@ -3708,6 +3892,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Auto Reveal Entries", description: "Whether to reveal when a corresponding outline entry becomes active.", field: Box::new(SettingField { + json_path: Some("outline_panel.auto_reveal_entries"), pick: |settings_content| { settings_content .outline_panel @@ -3729,6 +3914,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Auto Fold Directories", description: "Whether to fold directories automatically when a directory contains only one subdirectory.", field: Box::new(SettingField { + json_path: Some("outline_panel.auto_fold_dirs"), pick: |settings_content| { settings_content .outline_panel @@ -3752,6 +3938,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "When to show indent guides in the outline panel.", field: Box::new( SettingField { + json_path: Some("outline_panel.indent_guides.show"), pick: |settings_content| { settings_content .outline_panel @@ -3778,6 +3965,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Git Panel Button", description: "Show the Git panel button in the status bar.", field: Box::new(SettingField { + json_path: Some("git_panel.button"), pick: |settings_content| { settings_content.git_panel.as_ref()?.button.as_ref() }, @@ -3792,6 +3980,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Git Panel Dock", description: "Where to dock the Git panel.", field: Box::new(SettingField { + json_path: Some("git_panel.dock"), pick: |settings_content| settings_content.git_panel.as_ref()?.dock.as_ref(), write: |settings_content, value| { settings_content.git_panel.get_or_insert_default().dock = value; @@ -3804,6 +3993,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Git Panel Default Width", description: "Default width of the Git panel in pixels.", field: Box::new(SettingField { + json_path: Some("git_panel.default_width"), pick: |settings_content| { settings_content.git_panel.as_ref()?.default_width.as_ref() }, @@ -3821,6 +4011,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Git Panel Status Style", description: "How entry statuses are displayed.", field: Box::new(SettingField { + json_path: Some("git_panel.status_style"), pick: |settings_content| { settings_content.git_panel.as_ref()?.status_style.as_ref() }, @@ -3838,6 +4029,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Fallback Branch Name", description: "Default branch name will be when init.defaultbranch is not set in Git.", field: Box::new(SettingField { + json_path: Some("git_panel.fallback_branch_name"), pick: |settings_content| { settings_content .git_panel @@ -3859,6 +4051,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Sort By Path", description: "Enable to sort entries in the panel by path, disable to sort by status.", field: Box::new(SettingField { + json_path: Some("git_panel.sort_by_path"), pick: |settings_content| { settings_content.git_panel.as_ref()?.sort_by_path.as_ref() }, @@ -3876,6 +4069,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Collapse Untracked Diff", description: "Whether to collapse untracked files in the diff panel.", field: Box::new(SettingField { + json_path: Some("git_panel.collapse_untracked_diff"), pick: |settings_content| { settings_content .git_panel @@ -3897,6 +4091,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Scroll Bar", description: "How and when the scrollbar should be displayed.", field: Box::new(SettingField { + json_path: Some("git_panel.scrollbar.show"), pick: |settings_content| { show_scrollbar_or_editor(settings_content, |settings_content| { settings_content @@ -3925,6 +4120,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Debugger Panel Dock", description: "The dock position of the debug panel.", field: Box::new(SettingField { + json_path: Some("debugger.dock"), pick: |settings_content| settings_content.debugger.as_ref()?.dock.as_ref(), write: |settings_content, value| { settings_content.debugger.get_or_insert_default().dock = value; @@ -3938,6 +4134,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Notification Panel Button", description: "Show the notification panel button in the status bar.", field: Box::new(SettingField { + json_path: Some("notification_panel.button"), pick: |settings_content| { settings_content .notification_panel @@ -3959,6 +4156,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Notification Panel Dock", description: "Where to dock the notification panel.", field: Box::new(SettingField { + json_path: Some("notification_panel.dock"), pick: |settings_content| { settings_content.notification_panel.as_ref()?.dock.as_ref() }, @@ -3976,6 +4174,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Notification Panel Default Width", description: "Default width of the notification panel in pixels.", field: Box::new(SettingField { + json_path: Some("notification_panel.default_width"), pick: |settings_content| { settings_content .notification_panel @@ -3998,6 +4197,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Collaboration Panel Button", description: "Show the collaboration panel button in the status bar.", field: Box::new(SettingField { + json_path: Some("collaboration_panel.button"), pick: |settings_content| { settings_content .collaboration_panel @@ -4019,6 +4219,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Collaboration Panel Dock", description: "Where to dock the collaboration panel.", field: Box::new(SettingField { + json_path: Some("collaboration_panel.dock"), pick: |settings_content| { settings_content.collaboration_panel.as_ref()?.dock.as_ref() }, @@ -4036,6 +4237,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Collaboration Panel Default Width", description: "Default width of the collaboration panel in pixels.", field: Box::new(SettingField { + json_path: Some("collaboration_panel.dock"), pick: |settings_content| { settings_content .collaboration_panel @@ -4058,6 +4260,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Agent Panel Button", description: "Whether to show the agent panel button in the status bar.", field: Box::new(SettingField { + json_path: Some("agent.button"), pick: |settings_content| settings_content.agent.as_ref()?.button.as_ref(), write: |settings_content, value| { settings_content.agent.get_or_insert_default().button = value; @@ -4070,6 +4273,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Agent Panel Dock", description: "Where to dock the agent panel.", field: Box::new(SettingField { + json_path: Some("agent.dock"), pick: |settings_content| settings_content.agent.as_ref()?.dock.as_ref(), write: |settings_content, value| { settings_content.agent.get_or_insert_default().dock = value; @@ -4082,6 +4286,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Agent Panel Default Width", description: "Default width when the agent panel is docked to the left or right.", field: Box::new(SettingField { + json_path: Some("agent.default_width"), pick: |settings_content| { settings_content.agent.as_ref()?.default_width.as_ref() }, @@ -4096,6 +4301,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Agent Panel Default Height", description: "Default height when the agent panel is docked to the bottom.", field: Box::new(SettingField { + json_path: Some("agent.default_height"), pick: |settings_content| { settings_content.agent.as_ref()?.default_height.as_ref() }, @@ -4119,6 +4325,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Stepping Granularity", description: "Determines the stepping granularity for debug operations.", field: Box::new(SettingField { + json_path: Some("agent.default_height"), pick: |settings_content| { settings_content .debugger @@ -4140,6 +4347,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Save Breakpoints", description: "Whether breakpoints should be reused across Zed sessions.", field: Box::new(SettingField { + json_path: Some("debugger.save_breakpoints"), pick: |settings_content| { settings_content .debugger @@ -4161,6 +4369,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Timeout", description: "Time in milliseconds until timeout error when connecting to a TCP debug adapter.", field: Box::new(SettingField { + json_path: Some("debugger.timeout"), pick: |settings_content| { settings_content.debugger.as_ref()?.timeout.as_ref() }, @@ -4175,6 +4384,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Log DAP Communications", description: "Whether to log messages between active debug adapters and Zed.", field: Box::new(SettingField { + json_path: Some("debugger.log_dap_communications"), pick: |settings_content| { settings_content .debugger @@ -4196,6 +4406,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Format DAP Log Messages", description: "Whether to format DAP messages when adding them to debug adapter logger.", field: Box::new(SettingField { + json_path: Some("debugger.format_dap_log_messages"), pick: |settings_content| { settings_content .debugger @@ -4225,6 +4436,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Shell", description: "What shell to use when opening a terminal.", field: Box::new(SettingField { + json_path: Some("terminal.shell$"), pick: |settings_content| { Some(&dynamic_variants::()[ settings_content @@ -4288,6 +4500,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Program", description: "The shell program to use.", field: Box::new(SettingField { + json_path: Some("terminal.shell.program"), pick: |settings_content| { match settings_content.terminal.as_ref()?.project.shell.as_ref() { Some(settings::Shell::Program(program)) => Some(program), @@ -4317,6 +4530,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Program", description: "The shell program to run.", field: Box::new(SettingField { + json_path: Some("terminal.shell.program"), pick: |settings_content| { match settings_content.terminal.as_ref()?.project.shell.as_ref() { Some(settings::Shell::WithArguments { program, .. }) => Some(program), @@ -4345,6 +4559,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "The arguments to pass to the shell program.", field: Box::new( SettingField { + json_path: Some("terminal.shell.args"), pick: |settings_content| { match settings_content.terminal.as_ref()?.project.shell.as_ref() { Some(settings::Shell::WithArguments { args, .. }) => Some(args), @@ -4374,6 +4589,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Title Override", description: "An optional string to override the title of the terminal tab.", field: Box::new(SettingField { + json_path: Some("terminal.shell.title_override"), pick: |settings_content| { match settings_content.terminal.as_ref()?.project.shell.as_ref() { Some(settings::Shell::WithArguments { title_override, .. }) => title_override.as_ref().or(DEFAULT_EMPTY_SHARED_STRING), @@ -4403,6 +4619,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Working Directory", description: "What working directory to use when launching the terminal.", field: Box::new(SettingField { + json_path: Some("terminal.working_directory$"), pick: |settings_content| { Some(&dynamic_variants::()[ settings_content @@ -4459,6 +4676,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Directory", description: "The directory path to use (will be shell expanded).", field: Box::new(SettingField { + json_path: Some("terminal.working_directory.always"), pick: |settings_content| { match settings_content.terminal.as_ref()?.project.working_directory.as_ref() { Some(settings::WorkingDirectory::Always { directory }) => Some(directory), @@ -4488,6 +4706,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Key-value pairs to add to the terminal's environment.", field: Box::new( SettingField { + json_path: Some("terminal.env"), pick: |settings_content| { settings_content.terminal.as_ref()?.project.env.as_ref() }, @@ -4509,6 +4728,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Activates the Python virtual environment, if one is found, in the terminal's working directory.", field: Box::new( SettingField { + json_path: Some("terminal.detect_venv"), pick: |settings_content| { settings_content .terminal @@ -4535,6 +4755,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Size", description: "Font size for terminal text. If not set, defaults to buffer font size.", field: Box::new(SettingField { + json_path: Some("terminal.font_size"), pick: |settings_content| { settings_content .terminal @@ -4553,6 +4774,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Family", description: "Font family for terminal text. If not set, defaults to buffer font family.", field: Box::new(SettingField { + json_path: Some("terminal.font_family"), pick: |settings_content| { settings_content .terminal @@ -4575,6 +4797,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Font fallbacks for terminal text. If not set, defaults to buffer font fallbacks.", field: Box::new( SettingField { + json_path: Some("terminal.font_fallbacks"), pick: |settings_content| { settings_content .terminal @@ -4598,6 +4821,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Font Weight", description: "Font weight for terminal text in CSS weight units (100-900).", field: Box::new(SettingField { + json_path: Some("terminal.font_weight"), pick: |settings_content| { settings_content.terminal.as_ref()?.font_weight.as_ref() }, @@ -4616,6 +4840,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Font features for terminal text.", field: Box::new( SettingField { + json_path: Some("terminal.font_features"), pick: |settings_content| { settings_content .terminal @@ -4641,6 +4866,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "Line height for terminal text.", field: Box::new( SettingField { + json_path: Some("terminal.line_height"), pick: |settings_content| { settings_content.terminal.as_ref()?.line_height.as_ref() }, @@ -4660,6 +4886,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Cursor Shape", description: "Default cursor shape for the terminal (bar, block, underline, or hollow).", field: Box::new(SettingField { + json_path: Some("terminal.cursor_shape"), pick: |settings_content| { settings_content.terminal.as_ref()?.cursor_shape.as_ref() }, @@ -4677,6 +4904,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Cursor Blinking", description: "Sets the cursor blinking behavior in the terminal.", field: Box::new(SettingField { + json_path: Some("terminal.blinking"), pick: |settings_content| { settings_content.terminal.as_ref()?.blinking.as_ref() }, @@ -4691,6 +4919,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Alternate Scroll", description: "Whether alternate scroll mode is active by default (converts mouse scroll to arrow keys in apps like Vim).", field: Box::new(SettingField { + json_path: Some("terminal.alternate_scroll"), pick: |settings_content| { settings_content .terminal @@ -4712,6 +4941,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Minimum Contrast", description: "The minimum APCA perceptual contrast between foreground and background colors (0-106).", field: Box::new(SettingField { + json_path: Some("terminal.minimum_contrast"), pick: |settings_content| { settings_content .terminal @@ -4734,6 +4964,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Option As Meta", description: "Whether the option key behaves as the meta key.", field: Box::new(SettingField { + json_path: Some("terminal.option_as_meta"), pick: |settings_content| { settings_content.terminal.as_ref()?.option_as_meta.as_ref() }, @@ -4751,6 +4982,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Copy On Select", description: "Whether selecting text in the terminal automatically copies to the system clipboard.", field: Box::new(SettingField { + json_path: Some("terminal.copy_on_select"), pick: |settings_content| { settings_content.terminal.as_ref()?.copy_on_select.as_ref() }, @@ -4768,6 +5000,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Keep Selection On Copy", description: "Whether to keep the text selection after copying it to the clipboard.", field: Box::new(SettingField { + json_path: Some("terminal.keep_selection_on_copy"), pick: |settings_content| { settings_content .terminal @@ -4790,6 +5023,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Default Width", description: "Default width when the terminal is docked to the left or right (in pixels).", field: Box::new(SettingField { + json_path: Some("terminal.default_width"), pick: |settings_content| { settings_content.terminal.as_ref()?.default_width.as_ref() }, @@ -4807,6 +5041,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Default Height", description: "Default height when the terminal is docked to the bottom (in pixels).", field: Box::new(SettingField { + json_path: Some("terminal.default_height"), pick: |settings_content| { settings_content.terminal.as_ref()?.default_height.as_ref() }, @@ -4825,6 +5060,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Max Scroll History Lines", description: "Maximum number of lines to keep in scrollback history (max: 100,000; 0 disables scrolling).", field: Box::new(SettingField { + json_path: Some("terminal.max_scroll_history_lines"), pick: |settings_content| { settings_content .terminal @@ -4847,6 +5083,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Breadcrumbs", description: "Display the terminal title in breadcrumbs inside the terminal pane.", field: Box::new(SettingField { + json_path: Some("terminal.toolbar.breadcrumbs"), pick: |settings_content| { settings_content .terminal @@ -4873,6 +5110,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Scrollbar", description: "When to show the scrollbar in the terminal.", field: Box::new(SettingField { + json_path: Some("terminal.scrollbar.show"), pick: |settings_content| { show_scrollbar_or_editor(settings_content, |settings_content| { settings_content @@ -4906,6 +5144,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Visibility", description: "Control whether Git status is shown in the editor's gutter.", field: Box::new(SettingField { + json_path: Some("git.git_gutter"), pick: |settings_content| settings_content.git.as_ref()?.git_gutter.as_ref(), write: |settings_content, value| { settings_content.git.get_or_insert_default().git_gutter = value; @@ -4919,6 +5158,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Debounce", description: "Debounce threshold in milliseconds after which changes are reflected in the Git gutter.", field: Box::new(SettingField { + json_path: Some("git.gutter_debounce"), pick: |settings_content| { settings_content.git.as_ref()?.gutter_debounce.as_ref() }, @@ -4934,6 +5174,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Enabled", description: "Whether or not to show Git blame data inline in the currently focused line.", field: Box::new(SettingField { + json_path: Some("git.inline_blame.enabled"), pick: |settings_content| { settings_content .git @@ -4959,6 +5200,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Delay", description: "The delay after which the inline blame information is shown.", field: Box::new(SettingField { + json_path: Some("git.inline_blame.delay_ms"), pick: |settings_content| { settings_content .git @@ -4984,6 +5226,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Padding", description: "Padding between the end of the source line and the start of the inline blame in columns.", field: Box::new(SettingField { + json_path: Some("git.inline_blame.padding"), pick: |settings_content| { settings_content .git @@ -5009,6 +5252,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Minimum Column", description: "The minimum column number at which to show the inline blame information.", field: Box::new(SettingField { + json_path: Some("git.inline_blame.min_column"), pick: |settings_content| { settings_content .git @@ -5034,6 +5278,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Commit Summary", description: "Show commit summary as part of the inline blame.", field: Box::new(SettingField { + json_path: Some("git.inline_blame.show_commit_summary"), pick: |settings_content| { settings_content .git @@ -5060,6 +5305,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Avatar", description: "Show the avatar of the author of the commit.", field: Box::new(SettingField { + json_path: Some("git.blame.show_avatar"), pick: |settings_content| { settings_content .git @@ -5086,6 +5332,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Show Author Name", description: "Show author name as part of the commit information in branch picker.", field: Box::new(SettingField { + json_path: Some("git.branch_picker.show_author_name"), pick: |settings_content| { settings_content .git @@ -5112,6 +5359,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Hunk Style", description: "How Git hunks are displayed visually in the editor.", field: Box::new(SettingField { + json_path: Some("git.hunk_style"), pick: |settings_content| settings_content.git.as_ref()?.hunk_style.as_ref(), write: |settings_content, value| { settings_content.git.get_or_insert_default().hunk_style = value; @@ -5130,6 +5378,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Mute On Join", description: "Whether the microphone should be muted when joining a channel or a call.", field: Box::new(SettingField { + json_path: Some("calls.mute_on_join"), pick: |settings_content| { settings_content.calls.as_ref()?.mute_on_join.as_ref() }, @@ -5144,6 +5393,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Share On Join", description: "Whether your current project should be shared when joining an empty channel.", field: Box::new(SettingField { + json_path: Some("calls.share_on_join"), pick: |settings_content| { settings_content.calls.as_ref()?.share_on_join.as_ref() }, @@ -5159,6 +5409,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Rodio Audio", description: "Opt into the new audio system.", field: Box::new(SettingField { + json_path: Some("audio.experimental.rodio_audio"), pick: |settings_content| { settings_content.audio.as_ref()?.rodio_audio.as_ref() }, @@ -5173,6 +5424,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Auto Microphone Volume", description: "Automatically adjust microphone volume (requires rodio audio).", field: Box::new(SettingField { + json_path: Some("audio.experimental.auto_microphone_volume"), pick: |settings_content| { settings_content .audio @@ -5194,6 +5446,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Auto Speaker Volume", description: "Automatically adjust volume of other call members (requires rodio audio).", field: Box::new(SettingField { + json_path: Some("audio.experimental.auto_speaker_volume"), pick: |settings_content| { settings_content .audio @@ -5215,6 +5468,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Denoise", description: "Remove background noises (requires rodio audio).", field: Box::new(SettingField { + json_path: Some("audio.experimental.denoise"), pick: |settings_content| settings_content.audio.as_ref()?.denoise.as_ref(), write: |settings_content, value| { settings_content.audio.get_or_insert_default().denoise = value; @@ -5227,6 +5481,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Legacy Audio Compatible", description: "Use audio parameters compatible with previous versions (requires rodio audio).", field: Box::new(SettingField { + json_path: Some("audio.experimental.legacy_audio_compatible"), pick: |settings_content| { settings_content .audio @@ -5254,6 +5509,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Disable AI", description: "Whether to disable all AI features in Zed.", field: Box::new(SettingField { + json_path: Some("disable_ai"), pick: |settings_content| settings_content.disable_ai.as_ref(), write: |settings_content, value| { settings_content.disable_ai = value; @@ -5267,6 +5523,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Always Allow Tool Actions", description: "When enabled, the agent can run potentially destructive actions without asking for your confirmation. This setting has no effect on external agents.", field: Box::new(SettingField { + json_path: Some("agent.always_allow_tool_actions"), pick: |settings_content| { settings_content .agent @@ -5288,6 +5545,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Single File Review", description: "When enabled, agent edits will also be displayed in single-file buffers for review.", field: Box::new(SettingField { + json_path: Some("agent.single_file_review"), pick: |settings_content| { settings_content.agent.as_ref()?.single_file_review.as_ref() }, @@ -5305,6 +5563,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Enable Feedback", description: "Show voting thumbs up/down icon buttons for feedback on agent edits.", field: Box::new(SettingField { + json_path: Some("agent.enable_feedback"), pick: |settings_content| { settings_content.agent.as_ref()?.enable_feedback.as_ref() }, @@ -5322,6 +5581,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Notify When Agent Waiting", description: "Where to show notifications when the agent has completed its response or needs confirmation before running a tool action.", field: Box::new(SettingField { + json_path: Some("agent.notify_when_agent_waiting"), pick: |settings_content| { settings_content .agent @@ -5343,6 +5603,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Play Sound When Agent Done", description: "Whether to play a sound when the agent has either completed its response, or needs user input.", field: Box::new(SettingField { + json_path: Some("agent.play_sound_when_agent_done"), pick: |settings_content| { settings_content .agent @@ -5364,6 +5625,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Expand Edit Card", description: "Whether to have edit cards in the agent panel expanded, showing a Preview of the diff.", field: Box::new(SettingField { + json_path: Some("agent.expand_edit_card"), pick: |settings_content| { settings_content.agent.as_ref()?.expand_edit_card.as_ref() }, @@ -5381,6 +5643,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Expand Terminal Card", description: "Whether to have terminal cards in the agent panel expanded, showing the whole command output.", field: Box::new(SettingField { + json_path: Some("agent.expand_terminal_card"), pick: |settings_content| { settings_content .agent @@ -5402,6 +5665,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Use Modifier To Send", description: "Whether to always use cmd-enter (or ctrl-enter on Linux or Windows) to send messages.", field: Box::new(SettingField { + json_path: Some("agent.use_modifier_to_send"), pick: |settings_content| { settings_content .agent @@ -5423,6 +5687,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Message Editor Min Lines", description: "Minimum number of lines to display in the agent message editor.", field: Box::new(SettingField { + json_path: Some("agent.message_editor_min_lines"), pick: |settings_content| { settings_content .agent @@ -5452,6 +5717,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { description: "The proxy to use for network requests.", field: Box::new( SettingField { + json_path: Some("proxy"), pick: |settings_content| settings_content.proxy.as_ref(), write: |settings_content, value| { settings_content.proxy = value; @@ -5469,6 +5735,7 @@ pub(crate) fn settings_data(cx: &App) -> Vec { title: "Server URL", description: "The URL of the Zed server to connect to.", field: Box::new(SettingField { + json_path: Some("server_url"), pick: |settings_content| settings_content.server_url.as_ref(), write: |settings_content, value| { settings_content.server_url = value; @@ -5535,6 +5802,7 @@ fn language_settings_data() -> Vec { title: "Tab Size", description: "How many columns a tab should occupy.", field: Box::new(SettingField { + json_path: Some("languages.$(language).tab_size"), // TODO(cameron): not JQ syntax because not URL-safe pick: |settings_content| { language_settings_field(settings_content, |language| language.tab_size.as_ref()) }, @@ -5551,6 +5819,7 @@ fn language_settings_data() -> Vec { title: "Hard Tabs", description: "Whether to indent lines using tab characters, as opposed to multiple spaces.", field: Box::new(SettingField { + json_path: Some("languages.$(language).hard_tabs"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.hard_tabs.as_ref() @@ -5569,6 +5838,7 @@ fn language_settings_data() -> Vec { title: "Auto Indent", description: "Whether indentation should be adjusted based on the context whilst typing.", field: Box::new(SettingField { + json_path: Some("languages.$(language).auto_indent"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.auto_indent.as_ref() @@ -5587,6 +5857,7 @@ fn language_settings_data() -> Vec { title: "Auto Indent On Paste", description: "Whether indentation of pasted content should be adjusted based on the context.", field: Box::new(SettingField { + json_path: Some("languages.$(language).auto_indent_on_paste"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.auto_indent_on_paste.as_ref() @@ -5606,6 +5877,7 @@ fn language_settings_data() -> Vec { title: "Soft Wrap", description: "How to soft-wrap long lines of text.", field: Box::new(SettingField { + json_path: Some("languages.$(language).soft_wrap"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.soft_wrap.as_ref() @@ -5624,6 +5896,7 @@ fn language_settings_data() -> Vec { title: "Show Wrap Guides", description: "Show wrap guides in the editor.", field: Box::new(SettingField { + json_path: Some("languages.$(language).show_wrap_guides"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.show_wrap_guides.as_ref() @@ -5642,6 +5915,7 @@ fn language_settings_data() -> Vec { title: "Preferred Line Length", description: "The column at which to soft-wrap lines, for buffers where soft-wrap is enabled.", field: Box::new(SettingField { + json_path: Some("languages.$(language).preferred_line_length"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.preferred_line_length.as_ref() @@ -5661,6 +5935,7 @@ fn language_settings_data() -> Vec { description: "Character counts at which to show wrap guides in the editor.", field: Box::new( SettingField { + json_path: Some("languages.$(language).wrap_guides"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.wrap_guides.as_ref() @@ -5681,6 +5956,7 @@ fn language_settings_data() -> Vec { title: "Allow Rewrap", description: "Controls where the `editor::rewrap` action is allowed for this language.", field: Box::new(SettingField { + json_path: Some("languages.$(language).allow_rewrap"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.allow_rewrap.as_ref() @@ -5700,6 +5976,7 @@ fn language_settings_data() -> Vec { title: "Enabled", description: "Display indent guides in the editor.", field: Box::new(SettingField { + json_path: Some("languages.$(language).indent_guides.enabled"), pick: |settings_content| { language_settings_field(settings_content, |language| { language @@ -5721,6 +5998,7 @@ fn language_settings_data() -> Vec { title: "Line Width", description: "The width of the indent guides in pixels, between 1 and 10.", field: Box::new(SettingField { + json_path: Some("languages.$(language).indent_guides.line_width"), pick: |settings_content| { language_settings_field(settings_content, |language| { language @@ -5742,6 +6020,7 @@ fn language_settings_data() -> Vec { title: "Active Line Width", description: "The width of the active indent guide in pixels, between 1 and 10.", field: Box::new(SettingField { + json_path: Some("languages.$(language).indent_guides.active_line_width"), pick: |settings_content| { language_settings_field(settings_content, |language| { language @@ -5766,6 +6045,7 @@ fn language_settings_data() -> Vec { title: "Coloring", description: "Determines how indent guides are colored.", field: Box::new(SettingField { + json_path: Some("languages.$(language).indent_guides.coloring"), pick: |settings_content| { language_settings_field(settings_content, |language| { language @@ -5787,6 +6067,7 @@ fn language_settings_data() -> Vec { title: "Background Coloring", description: "Determines how indent guide backgrounds are colored.", field: Box::new(SettingField { + json_path: Some("languages.$(language).indent_guides.background_coloring"), pick: |settings_content| { language_settings_field(settings_content, |language| { language @@ -5814,6 +6095,7 @@ fn language_settings_data() -> Vec { field: Box::new( // TODO(settings_ui): this setting should just be a bool SettingField { + json_path: Some("languages.$(language).format_on_save"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.format_on_save.as_ref() @@ -5833,6 +6115,7 @@ fn language_settings_data() -> Vec { 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 { + json_path: Some("languages.$(language).remove_trailing_whitespace_on_save"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.remove_trailing_whitespace_on_save.as_ref() @@ -5851,6 +6134,7 @@ fn language_settings_data() -> Vec { 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 { + json_path: Some("languages.$(language).ensure_final_newline_on_save"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.ensure_final_newline_on_save.as_ref() @@ -5870,6 +6154,7 @@ fn language_settings_data() -> Vec { description: "How to perform a buffer format.", field: Box::new( SettingField { + json_path: Some("languages.$(language).formatter"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.formatter.as_ref() @@ -5890,6 +6175,7 @@ fn language_settings_data() -> Vec { title: "Use On Type Format", description: "Whether to use additional LSP queries to format (and amend) the code after every \"trigger\" symbol input, defined by LSP server capabilities", field: Box::new(SettingField { + json_path: Some("languages.$(language).use_on_type_format"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.use_on_type_format.as_ref() @@ -5909,6 +6195,7 @@ fn language_settings_data() -> Vec { description: "Additional code actions to run when formatting.", field: Box::new( SettingField { + json_path: Some("languages.$(language).code_actions_on_format"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.code_actions_on_format.as_ref() @@ -5930,6 +6217,7 @@ fn language_settings_data() -> Vec { title: "Use Autoclose", description: "Whether to automatically type closing characters for you. For example, when you type '(', Zed will automatically add a closing ')' at the correct position.", field: Box::new(SettingField { + json_path: Some("languages.$(language).use_autoclose"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.use_autoclose.as_ref() @@ -5948,6 +6236,7 @@ fn language_settings_data() -> Vec { title: "Use Auto Surround", description: "Whether to automatically surround text with characters for you. For example, when you select text and type '(', Zed will automatically surround text with ().", field: Box::new(SettingField { + json_path: Some("languages.$(language).use_auto_surround"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.use_auto_surround.as_ref() @@ -5966,6 +6255,7 @@ fn language_settings_data() -> Vec { title: "Always Treat Brackets As Autoclosed", description: "Controls whether the closing characters are always skipped over and auto-removed no matter how they were inserted.", field: Box::new(SettingField { + json_path: Some("languages.$(language).always_treat_brackets_as_autoclosed"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.always_treat_brackets_as_autoclosed.as_ref() @@ -5984,6 +6274,7 @@ fn language_settings_data() -> Vec { title: "Jsx Tag Auto Close", description: "Whether to automatically close JSX tags.", field: Box::new(SettingField { + json_path: Some("languages.$(language).jsx_tag_auto_close"), // TODO(settings_ui): this setting should just be a bool pick: |settings_content| { language_settings_field(settings_content, |language| { @@ -6004,6 +6295,7 @@ fn language_settings_data() -> Vec { title: "Show Edit Predictions", description: "Controls whether edit predictions are shown immediately (true) or manually by triggering `editor::showeditprediction` (false).", field: Box::new(SettingField { + json_path: Some("languages.$(language).show_edit_predictions"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.show_edit_predictions.as_ref() @@ -6023,6 +6315,7 @@ fn language_settings_data() -> Vec { description: "Controls whether edit predictions are shown in the given language scopes.", field: Box::new( SettingField { + json_path: Some("languages.$(language).edit_predictions_disabled_in"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.edit_predictions_disabled_in.as_ref() @@ -6044,6 +6337,7 @@ fn language_settings_data() -> Vec { title: "Show Whitespaces", description: "Whether to show tabs and spaces in the editor.", field: Box::new(SettingField { + json_path: Some("languages.$(language).show_whitespaces"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.show_whitespaces.as_ref() @@ -6063,6 +6357,7 @@ fn language_settings_data() -> Vec { description: "Visible character used to render space characters when show_whitespaces is enabled (default: \"•\")", field: Box::new( SettingField { + json_path: Some("languages.$(language).whitespace_map.space"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.whitespace_map.as_ref()?.space.as_ref() @@ -6084,6 +6379,7 @@ fn language_settings_data() -> Vec { description: "Visible character used to render tab characters when show_whitespaces is enabled (default: \"→\")", field: Box::new( SettingField { + json_path: Some("languages.$(language).whitespace_map.tab"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.whitespace_map.as_ref()?.tab.as_ref() @@ -6105,6 +6401,7 @@ fn language_settings_data() -> Vec { 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 { + json_path: Some("languages.$(language).show_completions_on_input"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.show_completions_on_input.as_ref() @@ -6123,6 +6420,7 @@ fn language_settings_data() -> Vec { title: "Show Completion Documentation", description: "Whether to display inline and alongside documentation for items in the completions menu.", field: Box::new(SettingField { + json_path: Some("languages.$(language).show_completion_documentation"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.show_completion_documentation.as_ref() @@ -6141,6 +6439,7 @@ fn language_settings_data() -> Vec { title: "Words", description: "Controls how words are completed.", field: Box::new(SettingField { + json_path: Some("languages.$(language).completions.words"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.completions.as_ref()?.words.as_ref() @@ -6159,6 +6458,7 @@ fn language_settings_data() -> Vec { title: "Words Min Length", description: "How many characters has to be in the completions query to automatically show the words-based completions.", field: Box::new(SettingField { + json_path: Some("languages.$(language).completions.words_min_length"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.completions.as_ref()?.words_min_length.as_ref() @@ -6181,6 +6481,7 @@ fn language_settings_data() -> Vec { title: "Enabled", description: "Global switch to toggle hints on and off.", field: Box::new(SettingField { + json_path: Some("languages.$(language).inlay_hints.enabled"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.inlay_hints.as_ref()?.enabled.as_ref() @@ -6199,6 +6500,7 @@ fn language_settings_data() -> Vec { title: "Show Value Hints", description: "Global switch to toggle inline values on and off when debugging.", field: Box::new(SettingField { + json_path: Some("languages.$(language).inlay_hints.show_value_hints"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.inlay_hints.as_ref()?.show_value_hints.as_ref() @@ -6220,6 +6522,7 @@ fn language_settings_data() -> Vec { title: "Show Type Hints", description: "Whether type hints should be shown.", field: Box::new(SettingField { + json_path: Some("languages.$(language).inlay_hints.show_type_hints"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.inlay_hints.as_ref()?.show_type_hints.as_ref() @@ -6238,6 +6541,7 @@ fn language_settings_data() -> Vec { title: "Show Parameter Hints", description: "Whether parameter hints should be shown.", field: Box::new(SettingField { + json_path: Some("languages.$(language).inlay_hints.show_parameter_hints"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.inlay_hints.as_ref()?.show_parameter_hints.as_ref() @@ -6259,6 +6563,7 @@ fn language_settings_data() -> Vec { title: "Show Other Hints", description: "Whether other hints should be shown.", field: Box::new(SettingField { + json_path: Some("languages.$(language).inlay_hints.show_other_hints"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.inlay_hints.as_ref()?.show_other_hints.as_ref() @@ -6280,6 +6585,7 @@ fn language_settings_data() -> Vec { title: "Show Background", description: "Show a background for inlay hints.", field: Box::new(SettingField { + json_path: Some("languages.$(language).inlay_hints.show_background"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.inlay_hints.as_ref()?.show_background.as_ref() @@ -6298,6 +6604,7 @@ fn language_settings_data() -> Vec { title: "Edit Debounce Ms", description: "Whether or not to debounce inlay hints updates after buffer edits (set to 0 to disable debouncing).", field: Box::new(SettingField { + json_path: Some("languages.$(language).inlay_hints.edit_debounce_ms"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.inlay_hints.as_ref()?.edit_debounce_ms.as_ref() @@ -6319,6 +6626,7 @@ fn language_settings_data() -> Vec { title: "Scroll Debounce Ms", description: "Whether or not to debounce inlay hints updates after buffer scrolls (set to 0 to disable debouncing).", field: Box::new(SettingField { + json_path: Some("languages.$(language).inlay_hints.scroll_debounce_ms"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.inlay_hints.as_ref()?.scroll_debounce_ms.as_ref() @@ -6341,6 +6649,7 @@ fn language_settings_data() -> Vec { description: "Toggles inlay hints (hides or shows) when the user presses the modifiers specified.", field: Box::new( SettingField { + json_path: Some("languages.$(language).inlay_hints.toggle_on_modifiers_press"), pick: |settings_content| { language_settings_field(settings_content, |language| { language @@ -6370,6 +6679,7 @@ fn language_settings_data() -> Vec { title: "LSP Document Colors", description: "How to render LSP color previews in the editor.", field: Box::new(SettingField { + json_path: Some("lsp_document_colors"), pick: |settings_content| settings_content.editor.lsp_document_colors.as_ref(), write: |settings_content, value| { settings_content.editor.lsp_document_colors = value; @@ -6385,6 +6695,7 @@ fn language_settings_data() -> Vec { title: "Enabled", description: "Whether tasks are enabled for this language.", field: Box::new(SettingField { + json_path: Some("languages.$(language).tasks.enabled"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.tasks.as_ref()?.enabled.as_ref() @@ -6405,6 +6716,7 @@ fn language_settings_data() -> Vec { description: "Extra task variables to set for a particular language.", field: Box::new( SettingField { + json_path: Some("languages.$(language).tasks.variables"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.tasks.as_ref()?.variables.as_ref() @@ -6426,6 +6738,7 @@ fn language_settings_data() -> Vec { title: "Prefer LSP", description: "Use LSP tasks over Zed language extension tasks.", field: Box::new(SettingField { + json_path: Some("languages.$(language).tasks.prefer_lsp"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.tasks.as_ref()?.prefer_lsp.as_ref() @@ -6447,6 +6760,7 @@ fn language_settings_data() -> Vec { description: "Preferred debuggers for this language.", field: Box::new( SettingField { + json_path: Some("languages.$(language).debuggers"), pick: |settings_content| { language_settings_field(settings_content, |language| language.debuggers.as_ref()) }, @@ -6466,6 +6780,7 @@ fn language_settings_data() -> Vec { title: "Middle Click Paste", description: "Enable middle-click paste on Linux.", field: Box::new(SettingField { + json_path: Some("languages.$(language).editor.middle_click_paste"), pick: |settings_content| settings_content.editor.middle_click_paste.as_ref(), write: |settings_content, value| {settings_content.editor.middle_click_paste = value;}, }), @@ -6476,6 +6791,7 @@ fn language_settings_data() -> Vec { 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 { + json_path: Some("languages.$(language).extend_comment_on_newline"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.extend_comment_on_newline.as_ref() @@ -6499,6 +6815,7 @@ fn language_settings_data() -> Vec { title: "Image Viewer", description: "The unit for image file sizes.", field: Box::new(SettingField { + json_path: Some("image_viewer.unit"), pick: |settings_content| { settings_content.image_viewer.as_ref().and_then(|image_viewer| image_viewer.unit.as_ref()) }, @@ -6514,6 +6831,7 @@ fn language_settings_data() -> Vec { title: "Auto Replace Emoji Shortcode", description: "Whether to automatically replace emoji shortcodes with emoji characters.", field: Box::new(SettingField { + json_path: Some("message_editor.auto_replace_emoji_shortcode"), pick: |settings_content| { settings_content.message_editor.as_ref().and_then(|message_editor| message_editor.auto_replace_emoji_shortcode.as_ref()) }, @@ -6529,6 +6847,7 @@ fn language_settings_data() -> Vec { title: "Drop Size Target", description: "Relative size of the drop target in the editor that will open dropped file as a split pane.", field: Box::new(SettingField { + json_path: Some("drop_target_size"), pick: |settings_content| { settings_content.workspace.drop_target_size.as_ref() }, @@ -6554,6 +6873,7 @@ fn non_editor_language_settings_data() -> Vec { title: "Enable Language Server", description: "Whether to use language servers to provide code intelligence.", field: Box::new(SettingField { + json_path: Some("languages.$(language).enable_language_server"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.enable_language_server.as_ref() @@ -6573,6 +6893,7 @@ fn non_editor_language_settings_data() -> Vec { description: "The list of language servers to use (or disable) for this language.", field: Box::new( SettingField { + json_path: Some("languages.$(language).language_servers"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.language_servers.as_ref() @@ -6593,6 +6914,7 @@ fn non_editor_language_settings_data() -> Vec { title: "Linked Edits", description: "Whether to perform linked edits of associated ranges, if the LS supports it. For example, when editing opening tag, the contents of the closing tag will be edited as well.", field: Box::new(SettingField { + json_path: Some("languages.$(language).linked_edits"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.linked_edits.as_ref() @@ -6611,6 +6933,7 @@ fn non_editor_language_settings_data() -> Vec { title: "Go To Definition Fallback", description: "Whether to follow-up empty Go to definition responses from the language server.", field: Box::new(SettingField { + json_path: Some("go_to_definition_fallback"), pick: |settings_content| settings_content.editor.go_to_definition_fallback.as_ref(), write: |settings_content, value| { settings_content.editor.go_to_definition_fallback = value; @@ -6624,6 +6947,7 @@ fn non_editor_language_settings_data() -> Vec { title: "Enabled", description: "Whether to fetch LSP completions or not.", field: Box::new(SettingField { + json_path: Some("languages.$(language).completions.lsp"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.completions.as_ref()?.lsp.as_ref() @@ -6642,6 +6966,7 @@ fn non_editor_language_settings_data() -> Vec { title: "Fetch Timeout (milliseconds)", description: "When fetching LSP completions, determines how long to wait for a response of a particular server (set to 0 to wait indefinitely).", field: Box::new(SettingField { + json_path: Some("languages.$(language).completions.lsp_fetch_timeout_ms"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.completions.as_ref()?.lsp_fetch_timeout_ms.as_ref() @@ -6663,6 +6988,7 @@ fn non_editor_language_settings_data() -> Vec { title: "Insert Mode", description: "Controls how LSP completions are inserted.", field: Box::new(SettingField { + json_path: Some("languages.$(language).completions.lsp_insert_mode"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.completions.as_ref()?.lsp_insert_mode.as_ref() @@ -6683,6 +7009,7 @@ fn non_editor_language_settings_data() -> Vec { description: "Preferred debuggers for this language.", field: Box::new( SettingField { + json_path: Some("languages.$(language).debuggers"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.debuggers.as_ref() @@ -6704,6 +7031,7 @@ fn non_editor_language_settings_data() -> Vec { title: "Allowed", description: "Enables or disables formatting with Prettier for a given language.", field: Box::new(SettingField { + json_path: Some("languages.$(language).prettier.allowed"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.prettier.as_ref()?.allowed.as_ref() @@ -6722,6 +7050,7 @@ fn non_editor_language_settings_data() -> Vec { title: "Parser", description: "Forces Prettier integration to use a specific parser name when formatting files with the language.", field: Box::new(SettingField { + json_path: Some("languages.$(language).prettier.parser"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.prettier.as_ref()?.parser.as_ref() @@ -6741,6 +7070,7 @@ fn non_editor_language_settings_data() -> Vec { description: "Forces Prettier integration to use specific plugins when formatting files with the language.", field: Box::new( SettingField { + json_path: Some("languages.$(language).prettier.plugins"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.prettier.as_ref()?.plugins.as_ref() @@ -6762,6 +7092,7 @@ fn non_editor_language_settings_data() -> Vec { description: "Default Prettier options, in the format as in package.json section for Prettier.", field: Box::new( SettingField { + json_path: Some("languages.$(language).prettier"), pick: |settings_content| { language_settings_field(settings_content, |language| { language.prettier.as_ref()?.options.as_ref() diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs index 0485b2608c99f74fbdc86d1cf0807ebb9727c7e8..9fa40418df4792978de1ff7fea074e1334d9dad0 100644 --- a/crates/settings_ui/src/settings_ui.rs +++ b/crates/settings_ui/src/settings_ui.rs @@ -34,7 +34,7 @@ use ui::{ use ui_input::{NumberField, NumberFieldType}; use util::{ResultExt as _, paths::PathStyle, rel_path::RelPath}; use workspace::{OpenOptions, OpenVisible, Workspace, client_side_decorations}; -use zed_actions::OpenSettings; +use zed_actions::{OpenSettings, OpenSettingsAt}; use crate::components::{SettingsInputField, font_picker, icon_theme_picker, theme_picker}; @@ -86,6 +86,25 @@ struct FocusFile(pub u32); struct SettingField { pick: fn(&SettingsContent) -> Option<&T>, write: fn(&mut SettingsContent, Option), + + /// A json-path-like string that gives a unique-ish string that identifies + /// where in the JSON the setting is defined. + /// + /// The syntax is `jq`-like, but modified slightly to be URL-safe (and + /// without the leading dot), e.g. `foo.bar`. + /// + /// They are URL-safe (this is important since links are the main use-case + /// for these paths). + /// + /// There are a couple of special cases: + /// - discrimminants are represented with a trailing `$`, for example + /// `terminal.working_directory$`. This is to distinguish the discrimminant + /// setting (i.e. the setting that changes whether the value is a string or + /// an object) from the setting in the case that it is a string. + /// - language-specific settings begin `languages.$(language)`. Links + /// targeting these settings should take the form `languages/Rust/...`, for + /// example, but are not currently supported. + json_path: Option<&'static str>, } impl Clone for SettingField { @@ -116,6 +135,7 @@ impl SettingField { SettingField { pick: |_| Some(&UnimplementedSettingField), write: |_, _| unreachable!(), + json_path: None, } } } @@ -132,6 +152,8 @@ trait AnySettingField { file_set_in: &settings::SettingsFile, cx: &App, ) -> Option>; + + fn json_path(&self) -> Option<&'static str>; } impl AnySettingField for SettingField { @@ -197,6 +219,10 @@ impl AnySettingField for SettingFi .log_err(); })); } + + fn json_path(&self) -> Option<&'static str> { + self.json_path + } } #[derive(Default, Clone)] @@ -344,13 +370,26 @@ impl FeatureFlag for SettingsUiFeatureFlag { pub fn init(cx: &mut App) { init_renderers(cx); + cx.observe_new(|workspace: &mut workspace::Workspace, _, _| { + workspace.register_action( + |workspace, OpenSettingsAt { path }: &OpenSettingsAt, window, cx| { + let window_handle = window + .window_handle() + .downcast::() + .expect("Workspaces are root Windows"); + open_settings_editor(workspace, Some(&path), window_handle, cx); + }, + ); + }) + .detach(); + cx.observe_new(|workspace: &mut workspace::Workspace, _, _| { workspace.register_action(|workspace, _: &OpenSettings, window, cx| { let window_handle = window .window_handle() .downcast::() .expect("Workspaces are root Windows"); - open_settings_editor(workspace, window_handle, cx); + open_settings_editor(workspace, None, window_handle, cx); }); }) .detach(); @@ -456,9 +495,61 @@ fn init_renderers(cx: &mut App) { pub fn open_settings_editor( _workspace: &mut Workspace, + path: Option<&str>, workspace_handle: WindowHandle, cx: &mut App, ) { + /// Assumes a settings GUI window is already open + fn open_path( + path: &str, + settings_window: &mut SettingsWindow, + window: &mut Window, + cx: &mut Context, + ) { + if path.starts_with("languages.$(language)") { + log::error!("language-specific settings links are not currently supported"); + return; + } + + settings_window.current_file = SettingsUiFile::User; + settings_window.build_ui(window, cx); + + let mut item_info = None; + 'search: for (nav_entry_index, entry) in settings_window.navbar_entries.iter().enumerate() { + if entry.is_root { + continue; + } + let page_index = entry.page_index; + let header_index = entry + .item_index + .expect("non-root entries should have an item index"); + for item_index in header_index + 1..settings_window.pages[page_index].items.len() { + let item = &settings_window.pages[page_index].items[item_index]; + if let SettingsPageItem::SectionHeader(_) = item { + break; + } + if let SettingsPageItem::SettingItem(item) = item { + if item.field.json_path() == Some(path) { + if !item.files.contains(USER) { + log::error!("Found item {}, but it is not a user setting", path); + return; + } + item_info = Some((item_index, nav_entry_index)); + break 'search; + } + } + } + } + let Some((item_index, navbar_entry_index)) = item_info else { + log::error!("Failed to find item for {}", path); + return; + }; + + settings_window.open_navbar_entry_page(navbar_entry_index); + window.focus(&settings_window.focus_handle_for_content_element(item_index, cx)); + settings_window.scroll_to_content_item(item_index, window, cx); + } + let existing_window = cx .windows() .into_iter() @@ -470,6 +561,9 @@ pub fn open_settings_editor( settings_window.original_window = Some(workspace_handle); settings_window.observe_last_window_close(cx); window.activate_window(); + if let Some(path) = path { + open_path(path, settings_window, window, cx); + } }) .ok(); return; @@ -477,6 +571,7 @@ pub fn open_settings_editor( // We have to defer this to get the workspace off the stack. + let path = path.map(ToOwned::to_owned); cx.defer(move |cx| { let current_rem_size: f32 = theme::ThemeSettings::get_global(cx).ui_font_size(cx).into(); @@ -508,7 +603,17 @@ pub fn open_settings_editor( window_bounds: Some(WindowBounds::centered(scaled_bounds, cx)), ..Default::default() }, - |window, cx| cx.new(|cx| SettingsWindow::new(Some(workspace_handle), window, cx)), + |window, cx| { + let settings_window = + cx.new(|cx| SettingsWindow::new(Some(workspace_handle), window, cx)); + settings_window.update(cx, |settings_window, cx| { + if let Some(path) = path { + open_path(&path, settings_window, window, cx); + } + }); + + settings_window + }, ) .log_err(); }); @@ -2112,17 +2217,7 @@ impl SettingsWindow { let entry_item_index = self.navbar_entries[navbar_entry_index] .item_index .expect("Non-root items should have an item index"); - let Some(selected_item_index) = self - .visible_page_items() - .position(|(index, _)| index == entry_item_index) - else { - return; - }; - - self.list_state.scroll_to(gpui::ListOffset { - item_ix: selected_item_index + 1, - offset_in_item: px(0.), - }); + self.scroll_to_content_item(entry_item_index, window, cx); if focus_content { handle_to_focus = Some(self.focus_handle_for_content_element(entry_item_index, cx)); } else { @@ -2159,6 +2254,32 @@ impl SettingsWindow { cx.notify(); } + fn scroll_to_content_item( + &self, + content_item_index: usize, + _window: &mut Window, + cx: &mut Context, + ) { + let index = self + .visible_page_items() + .position(|(index, _)| index == content_item_index) + .unwrap_or(0); + if index == 0 { + self.sub_page_scroll_handle + .set_offset(point(px(0.), px(0.))); + self.list_state.scroll_to(gpui::ListOffset { + item_ix: 0, + offset_in_item: px(0.), + }); + return; + } + self.list_state.scroll_to(gpui::ListOffset { + item_ix: index + 1, + offset_in_item: px(0.), + }); + cx.notify(); + } + fn is_nav_entry_visible(&self, nav_entry_index: usize) -> bool { self.visible_navbar_entries() .any(|(index, _)| index == nav_entry_index) @@ -3173,7 +3294,7 @@ fn render_icon_theme_picker( } #[cfg(test)] -mod test { +pub mod test { use super::*; @@ -3194,7 +3315,7 @@ mod test { } } - fn register_settings(cx: &mut App) { + pub fn register_settings(cx: &mut App) { settings::init(cx); theme::init(theme::LoadThemes::JustBase, cx); workspace::init_settings(cx); diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 92897bc3344c710f4d694667a21040100a23a3cc..93feb4a71d18164501955b46187a14d6757d861e 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -847,6 +847,18 @@ fn handle_open_request(request: OpenRequest, app_state: Arc, cx: &mut .detach(); }); } + OpenRequestKind::Setting { setting_path } => { + // zed://settings/languages/$(language)/tab_size - DONT SUPPORT + // zed://settings/languages/Rust/tab_size - SUPPORT + // languages.$(language).tab_size + // [ languages $(language) tab_size] + workspace::with_active_or_new_workspace(cx, |_workspace, window, cx| { + window.dispatch_action( + Box::new(zed_actions::OpenSettingsAt { path: setting_path }), + cx, + ); + }); + } } return; diff --git a/crates/zed/src/zed/open_listener.rs b/crates/zed/src/zed/open_listener.rs index 3e0250825860aa358bb43125267dd4be8299b736..618849b3474e60f8a3737facf7c502f6e5f1cf52 100644 --- a/crates/zed/src/zed/open_listener.rs +++ b/crates/zed/src/zed/open_listener.rs @@ -47,6 +47,7 @@ pub enum OpenRequestKind { AgentPanel, DockMenuAction { index: usize }, BuiltinJsonSchema { schema_path: String }, + Setting { setting_path: String }, } impl OpenRequest { @@ -93,6 +94,10 @@ impl OpenRequest { this.kind = Some(OpenRequestKind::BuiltinJsonSchema { schema_path: schema_path.to_string(), }); + } else if let Some(setting_path) = url.strip_prefix("zed://settings/") { + this.kind = Some(OpenRequestKind::Setting { + setting_path: setting_path.to_string(), + }); } else if url.starts_with("ssh://") { this.parse_ssh_file_path(&url, cx)? } else if let Some(request_path) = parse_zed_link(&url, cx) { diff --git a/crates/zed_actions/src/lib.rs b/crates/zed_actions/src/lib.rs index d62de329c9af63ab8c15e1703b2517ac12594195..521405edc29845f6d459b3924355a5d8ea4a1bf8 100644 --- a/crates/zed_actions/src/lib.rs +++ b/crates/zed_actions/src/lib.rs @@ -30,12 +30,12 @@ pub struct OpenZedUrl { actions!( zed, [ + /// Opens the settings editor. #[action(deprecated_aliases = ["zed_actions::OpenSettingsEditor"])] OpenSettings, /// Opens the settings JSON file. #[action(deprecated_aliases = ["zed_actions::OpenSettings"])] OpenSettingsFile, - /// Opens the settings editor. /// Opens the default keymap file. OpenDefaultKeymap, /// Opens the user keymap file. @@ -107,6 +107,16 @@ pub struct IncreaseBufferFontSize { pub persist: bool, } +/// Increases the font size in the editor buffer. +#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)] +#[action(namespace = zed)] +#[serde(deny_unknown_fields)] +pub struct OpenSettingsAt { + /// A path to a specific setting (e.g. `theme.mode`) + #[serde(default)] + pub path: String, +} + /// Resets the buffer font size to the default value. #[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)] #[action(namespace = zed)]