Fix settings migrations for nested platform/channel/profile keys#48550
Merged
Fix settings migrations for nested platform/channel/profile keys#48550
Conversation
…channel override keys in migrations - Add strum EnumIter + IntoStaticStr derives to ReleaseChannel - Add SupportedPlatform enum with EnumIter - Make gpui and semver optional deps behind a 'gpui' feature - Replace hardcoded PLATFORM_AND_CHANNEL_KEYS in migrations with ReleaseChannel::iter() and SupportedPlatform::iter() - Remove test case that expected non-object edit_predictions to skip
The IntoStaticStr derive was not used anywhere. EnumIter is kept as it is used by the settings migrations.
…ined Add test cases to test_move_edit_prediction_provider_to_edit_predictions and test_migrate_experimental_sweep_mercury that verify migrations work correctly when the same setting appears simultaneously at the root level, inside a platform override (e.g. macos/linux), and inside a profile.
Update the doc comment to make it clear the returned values are the JSON keys used in settings files for platform-specific overrides.
The branch had changed .log_err() to .ok() and replaced expr.log_err() with let _ = expr, which silently discards errors. Per project rules, errors should never be silently discarded. Restore all affected call sites to use .log_err() and re-add the util::ResultExt import.
…rplate Both m_2026_02_02 and m_2026_02_03 had identical code for iterating over the root settings object, platform/channel overrides, and profile settings. Extract this into a shared migrate_nested_settings() helper in the migrations module that takes a callback and applies it to each nested settings map.
…migrations Refactor make_file_finder_include_ignored_an_enum and make_relative_line_numbers_an_enum to use the migrate_nested_settings helper so they correctly handle platform, release-channel, and profile override objects. Each migration now extracts its core logic into a migrate_one helper that operates on a single Map, and delegates to migrate_nested_settings to apply it across all nested scopes. Added tests for platform overrides and profile settings for both migrations.
Replace the release_channel dependency (which required feature-gating gpui and touching 40+ Cargo.toml files) with a simple inlined constant of the override keys used in settings JSON.
…oded strings Feature-gate gpui/semver as optional in release_channel (default on), add SupportedPlatform enum and strum::EnumIter derives. The migrator uses a direct path dep with default-features = false to avoid pulling in gpui, so no other crate's Cargo.toml needs to change. Also updates m_2025_11_25::remove_context_server_source to use migrate_nested_settings so context_servers.*.source is removed from platform, release-channel, and profile overrides too.
Add migrate_nested_language_setting helper that composes both nesting strategies: for each level (root, platform overrides, release-channel overrides, profiles), it applies the migration to the value itself and to each language under its 'languages' key. Update m_2025_10_01, m_2025_10_02, and m_2025_10_16 to use it. Remove the now-unused migrate_language_setting.
Extract platform and release-channel override fields from UserSettingsContent into PlatformOverrides and ReleaseChannelOverrides structs with #[serde(flatten)]. Each struct exposes an OVERRIDE_KEYS constant listing its field names. The migrator imports these constants from settings_content directly, so the override keys used in migrations are always in sync with the actual settings struct fields. This removes the release_channel and strum dependencies from the migrator, and reverts release_channel back to its original state (no feature gating needed).
Add a settings_overrides! macro in settings_content that generates the struct definition, OVERRIDE_KEYS const, and get_by_key accessor from a single field list. The field names appear exactly once. for_os() and for_release_channel() now use get_by_key() instead of hand-written match arms with duplicated key strings.
6e7f718 to
a2d2644
Compare
…nguage_setting -> migrate_language_setting Drop the 'nested' qualifier since all migrations should handle overrides by default.
rtfeldman
commented
Feb 6, 2026
| /// Migrate language settings, | ||
| /// calls `migrate_fn` with the top level object as well as all language settings under the "languages" key | ||
| /// Fails early if `migrate_fn` returns an error at any point | ||
| pub fn migrate_language_setting( |
Contributor
Author
There was a problem hiding this comment.
This function is now in migrator.rs (and is revised)
naaiyy
added a commit
to Glass-HQ/Glass
that referenced
this pull request
Feb 16, 2026
Key changes: - LSP folding ranges support (zed-industries#48611) - textDocument/foldingRange with custom fold text - LSP refactoring (zed-industries#48604) - extracted document_colors, code_lens, folding_ranges into modules - Crate graph restructuring (zed-industries#48602) - terminal moved closer to editor - Side-by-side diff searching (zed-industries#48539) and OpenExcerpts for LHS (zed-industries#48438) - SplittableEditor: sync custom blocks between RHS/LHS (zed-industries#48575) - Thinking effort for Zed/OpenAI providers (zed-industries#48545, zed-industries#48605) - Agent default_model.enable_thinking setting (zed-industries#48536) - Configurable LSP timeout setting (zed-industries#44745) - PaneSearchBarCallbacks global (search bar setup extracted from vim) - Settings migrations for nested platform/channel/profile keys (zed-industries#48550) - Shell parser: I/O redirects, here-documents, compound commands (zed-industries#48635) - Hardened tool authorization: sensitive settings, deferred ops (zed-industries#48641) - rm security bypass fixes (zed-industries#48640, zed-industries#48647) - MCP tool name parsing fix: newline delimiter (zed-industries#48636) - Canonicalize --user-data-dir path (zed-industries#48470) - Fix text_threads_dir XDG spec compliance (zed-industries#45771) - Buffer font for folds (zed-industries#48652) - Multibuffer toolbar layout shift fix (zed-industries#48472) - Editor: tabs bitmask syncing (zed-industries#48366) Conflict resolution: - collab tests: deleted (collab removed) - util/archive.rs, util/shell.rs: deleted (extracted to Obsydian) - copilot_ui/sign_in.rs: kept native_button style - editor_tests.rs: merged imports (kept MoveItemToPaneInDirection, added ViewId/FollowEvent) - lsp_store.rs: took upstream refactored imports, added FoldingRangeData, removed collab imports - main.rs: added PaneSearchBarCallbacks, removed vim::init Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, some settings migrations only operated on root-level keys and missed settings nested under platform keys (
macos,linux, etc.), channel keys (nightly,stable, etc.), or profile blocks. This fixes migrations to recurse into those nested locations.Also fixes
m_2026_02_02to gracefully skip whenedit_predictionsis not an object (e.g.true) instead of bailing and aborting the entire migration chain.Release Notes: