Skip to content

Support OS-specific settings in settings.json - #335281

Open
Yang Zongze (lrtfm) wants to merge 1 commit into
microsoft:mainfrom
lrtfm:feature/os-specific-settings
Open

Yang Zongze (lrtfm) wants to merge 1 commit into
microsoft:mainfrom
lrtfm:feature/os-specific-settings

Conversation

@lrtfm

@lrtfm Yang Zongze (lrtfm) commented Sep 9, 2026 •

Copy link
Copy Markdown

Fixes #5595

Summary

  • Adds windows, osx, and linux blocks to settings.json.
  • Applies the matching platform block within each configuration scope while preserving normal user, workspace, and folder precedence.
  • Supports language-specific overrides nested inside platform blocks.
  • Uses the following precedence: common settings → platform settings → language settings → platform-specific language settings.
  • Adds schema completion and validation for platform and nested language blocks.
  • Preserves platform settings correctly through Settings Sync, including ignored settings and concurrent changes.
{
	"editor.fontSize": 16,

	"osx": {
		"vim.autoSwitchInputMethod.obtainIMCmd": "/opt/homebrew/bin/macism",

		"[typescript]": {
			"editor.defaultFormatter": "esbenp.prettier-vscode"
		}
	},

	"windows": {
		"vim.autoSwitchInputMethod.obtainIMCmd": "im-select.exe"
	},

	"linux": {
		"vim.autoSwitchInputMethod.enable": false
	}
}

Profiles remain independent from the operating system, allowing the same workflow profile to be reused across platforms. The syntax follows the existing platform-specific configuration precedent in tasks.json.

Testing

  • npm run typecheck-client
  • npm run transpile-client
  • ESLint on all changed files
  • Targeted configuration, schema, Settings Sync, and profile tests: 84 passing

Copilot AI balanced review requested due to automatic review settings September 9, 2026 15:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Remote extension hosts can miss configuration events, and schema completion currently advertises unsupported nested language blocks.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds OS-specific settings.json overrides while preserving configuration scope and language precedence.

Changes:

  • Adds [windows], [osx], and [linux] resolution.
  • Adds schema support and separates platform from language overrides.
  • Adds platform resolution and change-reporting tests.
File summaries
File Description
configurationService.ts Adds platform block schemas.
configurationRegistry.ts Defines platform identifiers and language-only patterns.
configurationModels.ts Resolves platform values across configuration scopes.
configurationRegistry.test.ts Tests override-pattern separation.
configurationModels.test.ts Tests platform precedence and changes.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lrtfm

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Platform blocks currently bypass Settings Sync exclusions and mishandle some accepted schema and bootstrap cases.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation and regression coverage consistently address platform resolution, schema behavior, profiles, and synchronization without unresolved defects.

Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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.

Allow to scope settings by platform

3 participants