VSCode settings import refactor (#40513)

A small follow-up to the settings refactor of a few weeks ago to move
all the VSCode settings imports
to one place.

This should make it easier to spot missing imports, and easier to test
the importer.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin
2025-10-17 17:47:05 +00:00
committed by GitHub
parent 62858f6a5c
commit 1fbe1e3512
19 changed files with 774 additions and 924 deletions
@@ -2,10 +2,7 @@ use editor::EditorSettings;
use gpui::Pixels;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use settings::{
DockSide, ProjectPanelEntrySpacing, Settings, SettingsContent, ShowDiagnostics,
ShowIndentGuides,
};
use settings::{DockSide, ProjectPanelEntrySpacing, Settings, ShowDiagnostics, ShowIndentGuides};
use ui::{
px,
scrollbars::{ScrollbarVisibility, ShowScrollbar},
@@ -86,39 +83,4 @@ impl Settings for ProjectPanelSettings {
open_file_on_paste: project_panel.open_file_on_paste.unwrap(),
}
}
fn import_from_vscode(vscode: &settings::VsCodeSettings, current: &mut SettingsContent) {
if let Some(hide_gitignore) = vscode.read_bool("explorer.excludeGitIgnore") {
current.project_panel.get_or_insert_default().hide_gitignore = Some(hide_gitignore);
}
if let Some(auto_reveal) = vscode.read_bool("explorer.autoReveal") {
current
.project_panel
.get_or_insert_default()
.auto_reveal_entries = Some(auto_reveal);
}
if let Some(compact_folders) = vscode.read_bool("explorer.compactFolders") {
current.project_panel.get_or_insert_default().auto_fold_dirs = Some(compact_folders);
}
if Some(false) == vscode.read_bool("git.decorations.enabled") {
current.project_panel.get_or_insert_default().git_status = Some(false);
}
if Some(false) == vscode.read_bool("problems.decorations.enabled") {
current
.project_panel
.get_or_insert_default()
.show_diagnostics = Some(ShowDiagnostics::Off);
}
if let (Some(false), Some(false)) = (
vscode.read_bool("explorer.decorations.badges"),
vscode.read_bool("explorer.decorations.colors"),
) {
current.project_panel.get_or_insert_default().git_status = Some(false);
current
.project_panel
.get_or_insert_default()
.show_diagnostics = Some(ShowDiagnostics::Off);
}
}
}