Settings refactor (#38367)

Co-Authored-By: Ben K <ben@zed.dev>
Co-Authored-By: Anthony <anthony@zed.dev>
Co-Authored-By: Mikayla <mikayla@zed.dev>

Release Notes:

- settings: Major internal changes to settings. The primary user-facing
effect is that some settings which did not make sense in project
settings files are no-longer read from there. (For example the inline
blame settings)

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
Conrad Irwin
2025-09-18 16:47:23 +00:00
committed by GitHub
co-authored by Ben Kunkle Mikayla Maki Anthony
parent 0a9023bce0
commit fcdab160f9
219 changed files with 11697 additions and 11894 deletions
+5 -6
View File
@@ -78,12 +78,7 @@ impl VsCodeSettings {
}
pub fn read_value(&self, setting: &str) -> Option<&Value> {
if let Some(value) = self.content.get(setting) {
return Some(value);
}
// TODO: maybe check if it's in [platform] settings for current platform as a fallback
// TODO: deal with language specific settings
None
self.content.get(setting)
}
pub fn read_string(&self, setting: &str) -> Option<&str> {
@@ -140,4 +135,8 @@ impl VsCodeSettings {
*setting = Some(s)
}
}
pub fn read_enum<T>(&self, key: &str, f: impl FnOnce(&str) -> Option<T>) -> Option<T> {
self.content.get(key).and_then(Value::as_str).and_then(f)
}
}