Skip to content

Support .code-workspace.local overrides - #282854

Open
Sébastien Marchand (sebmarchand) wants to merge 1 commit into
microsoft:mainfrom
sebmarchand:feat/code-workspace-local
Open

Sébastien Marchand (sebmarchand) wants to merge 1 commit into
microsoft:mainfrom
sebmarchand:feat/code-workspace-local

Conversation

@sebmarchand

Copy link
Copy Markdown

Fixes/Refs: Fixes #282806

Summary
Adds automatic support for sibling *.code-workspace.local files. When present, VS Code loads and merges the local file on
top of the tracked *.code-workspace file, enabling per‑checkout/personal overrides without committing changes to the shared
workspace.

Behavior / Merge Rules

  • settings: deep merge, local values override shared values.
  • folders: ignored from .local (workspace structure stays shared).
  • extensions.recommendations / extensions.unwantedRecommendations: concatenate arrays (local additions only).
  • tasks / launch: deep merge with array concatenation for additive local configs.
  • If no .local file exists or it’s invalid, VS Code falls back to the main workspace file.

Implementation Notes

  • Added local override discovery + merge helpers in src/vs/platform/workspaces/common/workspaces.ts.
  • Workspace config loading now reads/merges .local and watches it for changes in src/vs/workbench/services/configuration/ browser/configuration.ts.
  • Workspace extension recommendations read merged config and react to local file changes; toggle actions still edit only the
    shared workspace file in src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.ts.
  • .code-workspace.local is treated like a workspace JSONC file for schema validation and completions via extensions/ configuration-editing.

Tests

  • ./scripts/test.sh --grep "workspace local overrides are merged"
  • ./scripts/test.sh --grep "WorkspaceExtensionsConfigService - Local Overrides"

Notes

  • Backward compatible and opt‑in: only active when a .code-workspace.local file exists.
  • Applies to saved workspaces (*.code-workspace), not untitled workspaces.

@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Benjamin Pasero (@bpasero)

Matched files:

  • src/vs/platform/workspaces/common/workspaces.ts

@sebmarchand

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support .code-workspace.local files for untracked local setting overrides

4 participants