Skip to content

Add extends support for workspace configuration files - #4

Open
snickell wants to merge 3 commits into
mainfrom
seth/configuration-extends
Open

snickell wants to merge 3 commits into
mainfrom
seth/configuration-extends

Conversation

@snickell

@snickell snickell commented Apr 10, 2026 •

Copy link
Copy Markdown
Owner

See #5 for all approaches to this problem, this is Approach 5 - General Config Composition.

This PR adds support for: {settings,tasks,launch,extensions}.json can call extends to pull in other {settings,tasks,launch,extensions}.*.json files.

Related to microsoft#15909.
Uses the same extends key as microsoft#299164.

Workspace configuration files do not support sharing a common base file today. This makes it hard to reuse settings across repositories or split workspace configuration into smaller files.

Example:

// .vscode/settings.shared.json
{
  "editor.tabSize": 2
}
// .vscode/settings.json
{
  "extends": "./settings.shared.json",
  "workbench.colorCustomizations": {
    "titleBar.activeBackground": "#1f6feb"
  }
}
// .vscode/tasks.shared.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build",
      "type": "shell",
      "command": "npm run build"
    }
  ]
}
// .vscode/tasks.json
{
  "extends": "./tasks.shared.json",
  "tasks": [
    {
      "label": "local build",
      "type": "shell",
      "command": "npm run build:local"
    }
  ]
}

With this change, the local file inherits from the shared file and overrides it where needed.

This change adds extends support to workspace configuration files.

  • support extends in settings.json, tasks.json, launch.json, extensions.json, and the corresponding sections in .code-workspace
  • resolve inherited files recursively and merge them with local values taking precedence
  • reject cycles and paths that escape the configuration root
  • watch inherited files and reload when they change
  • add schema entries and tests

Alternative Approaches

Internal name PR Mechanism Stronger where this is weaker Weaker where this is stronger
1 - Single Sidecar Overlay PR #2 .vscode/settings.local.json more direct answer to per-checkout local settings in folder workspaces narrower scope, settings-only
3 - Parallel Overlay Folder PR #3 .vscode.local/{settings,tasks,launch,extensions}.json gives one explicit local override location across several workspace files new convention, weaker upstream alignment
4 - First-Class Local Targets PR #1 .vscode/{settings,tasks,launch,extensions}.local.json and corresponding *.code-workspace.local sections as first-class workspace targets with separate provenance, inspect semantics, and editing paths preserves separate provenance and editing semantics across the local workspace file family much larger, more product-facing, and less aligned with current inheritance work

Pros:

  • closest to current upstream inheritance work
  • works beyond settings.json
  • supports reuse of shared base files as well as local overrides

Cons:

  • less direct than a dedicated local-settings feature
  • requires users to adopt composition explicitly
  • does not model local values as a separate configuration target

@snickell snickell changed the title Add configuration inheritance via extends Add extends support for workspace configuration files Apr 10, 2026
@snickell
snickell force-pushed the seth/configuration-extends branch from 773ac1f to 2d4c30b Compare April 11, 2026 22:03
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.

1 participant