Revert "settings: Remove auxiliary Content types where possible (#16744)" (#17768)

This breaks setting `{"scrollbar": {"show":"never"}}`
Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-09-12 14:46:08 -04:00 committed by GitHub
parent 3b37db4140
commit 4d26f83d23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 686 additions and 833 deletions

View file

@ -25,8 +25,7 @@ impl WorktreeSettings {
}
}
#[derive(Clone, Serialize, Deserialize, JsonSchema)]
#[serde(default)]
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
pub struct WorktreeSettingsContent {
/// Completely ignore files matching globs from `file_scan_exclusions`
///
@ -40,42 +39,12 @@ pub struct WorktreeSettingsContent {
/// "**/.classpath",
/// "**/.settings"
/// ]
pub file_scan_exclusions: Vec<String>,
#[serde(default)]
pub file_scan_exclusions: Option<Vec<String>>,
/// Treat the files matching these globs as `.env` files.
/// Default: [ "**/.env*" ]
pub private_files: Vec<String>,
}
impl Default for WorktreeSettingsContent {
fn default() -> Self {
Self {
private_files: [
"**/.env*",
"**/*.pem",
"**/*.key",
"**/*.cert",
"**/*.crt",
"**/secrets.yml",
]
.into_iter()
.map(str::to_owned)
.collect(),
file_scan_exclusions: [
"**/.git",
"**/.svn",
"**/.hg",
"**/CVS",
"**/.DS_Store",
"**/Thumbs.db",
"**/.classpath",
"**/.settings",
]
.into_iter()
.map(str::to_owned)
.collect(),
}
}
pub private_files: Option<Vec<String>>,
}
impl Settings for WorktreeSettings {
@ -88,8 +57,8 @@ impl Settings for WorktreeSettings {
_: &mut AppContext,
) -> anyhow::Result<Self> {
let result: WorktreeSettingsContent = sources.json_merge()?;
let mut file_scan_exclusions = result.file_scan_exclusions;
let mut private_files = result.private_files;
let mut file_scan_exclusions = result.file_scan_exclusions.unwrap_or_default();
let mut private_files = result.private_files.unwrap_or_default();
file_scan_exclusions.sort();
private_files.sort();
Ok(Self {