zed/assets
Mikayla Maki 43061b6b16
Add SettingsFile APIs to SettingsStore (#39129)
Closes #ISSUE

Adds a couple functions to the `SettingsStore`:
- `get_value_from_file`: Gets a value from a given settings file
(`Local`, `User`, etc) and if the value isn't found in the requested
file, walks the known settings files in the order in which they are
merged to find the settings value in lower precedence settings files
(i.e. if value not set anywhere will always return default value)
- `get_overrides_for_field`: Returns a list of settings files where a
given setting is set that have higher precedence than the passed in
file. e.g. passing in user will result in project settings files where
the value is set being returned.

Additionally changes the default for the `project_name` setting to
uphold the rules we are attempting to enforce on the settings, namely:
- All settings fields should be of the form `Option<T>`
- `None` (or `null` in JSON) should never be a meaningful value

Follow up PRs will handle implementing a function to write to an
arbitrary settings file, and passing through metadata to the above
functions to control how overrides are determined for more complicated
cases like `SaturatingBool` (`disable_ai`) and `ExtendingVec`

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Anthony <anthony@zed.dev>
2025-09-30 17:08:06 +00:00
..
badge Adjust Zed badge (#35294) 2025-07-29 15:09:31 -04:00
fonts Use IBM Plex Sans / Lilex (#36084) 2025-08-13 13:25:52 -06:00
icons rules library: Improve delineation of default and non-default rules (#39209) 2025-09-30 12:27:23 -03:00
images Add onboarding banner for claude code support (#37443) 2025-09-03 10:59:14 +00:00
keymaps agent: Fix keybinding to deny running a command (#39214) 2025-09-30 12:27:09 -03:00
prompts remove extra brace in rules template (#37356) 2025-09-02 15:26:12 +00:00
settings Add SettingsFile APIs to SettingsStore (#39129) 2025-09-30 17:08:06 +00:00
sounds call: Play a different sound when a guest joins (#38987) 2025-09-27 09:20:55 -04:00
themes Remove bold inlay hints style from all other theme variants (#39177) 2025-09-30 08:27:24 +00:00