Skip to content

Add JSONC support for .vscode configuration files - #270933

Open
Parham MohammadAlizadeh (Prhmma) wants to merge 3 commits into
microsoft:mainfrom
Prhmma:feature/jsonc-vscode-configs
Open

Add JSONC support for .vscode configuration files#270933
Parham MohammadAlizadeh (Prhmma) wants to merge 3 commits into
microsoft:mainfrom
Prhmma:feature/jsonc-vscode-configs

Conversation

@Prhmma

@Prhmma Parham MohammadAlizadeh (Prhmma) commented Oct 11, 2025

Copy link
Copy Markdown

Add JSONC support for .vscode configuration files

Fixes #269824

  • Support settings.jsonc, tasks.jsonc, launch.jsonc, mcp.jsonc, and extensions.jsonc
  • Maintain backward compatibility with .json files, taking precedence
  • Update configuration loading to try .json first, then .jsonc as a fallback
  • Add comprehensive test coverage for JSONC file resolution
  • Update split settings editor to handle both .json and .jsonc patterns
  • Enhance workspace extension recommendations to support both formats

Manually tested with local instance, it works

@Prhmma Parham MohammadAlizadeh (Prhmma) changed the title Add JSONC support for .vscode configuration files WIP | Add JSONC support for .vscode configuration files Oct 11, 2025
@Prhmma Parham MohammadAlizadeh (Prhmma) changed the title WIP | Add JSONC support for .vscode configuration files Add JSONC support for .vscode configuration files Oct 11, 2025
@mschoettle

Copy link
Copy Markdown

Parham MohammadAlizadeh (@Prhmma) Raymond Zhao (@rzhao271) What's the status of this? It would be great to get support for this

@Prhmma

Copy link
Copy Markdown
Author

Parham MohammadAlizadeh (@Prhmma) Raymond Zhao (@rzhao271) What's the status of this? It would be great to get support for this

It is ready for review,

@mschoettle

Copy link
Copy Markdown

Can you bring it up to date with main and resolve conflicts?

…configs

# Conflicts:
#	src/vs/workbench/services/configuration/browser/configuration.ts
Copilot AI review requested due to automatic review settings July 22, 2026 21:05
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

Raymond Zhao (@rzhao271)

Matched files:

  • src/vs/workbench/contrib/preferences/common/preferencesContribution.ts

@Prhmma

Copy link
Copy Markdown
Author

Can you bring it up to date with main and resolve conflicts?

merge conflict resolved

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.

Pull request overview

Adds .jsonc fallback support for workspace configuration files while preserving .json precedence.

Changes:

  • Resolves settings, tasks, launch, MCP, and extension recommendations from .jsonc.
  • Updates editor and recommendation workflows for JSONC resources.
  • Adds JSONC loading and precedence tests.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
preferences.ts Defines settings JSONC candidates.
workspaceExtensionsConfig.ts Loads and edits extensions.jsonc.
configurationService.test.ts Tests JSONC configuration loading.
jsonEditingService.ts Adds JSONC write fallback.
configuration.ts (common) Defines configuration candidates.
configuration.ts (browser) Resolves and watches JSONC files.
preferencesContribution.ts Registers the split editor for JSONC.
extensionRecommendationsService.test.ts Tests JSONC recommendations.
extensionsActions.ts Opens existing extensions.jsonc.

Comment thread src/vs/workbench/services/preferences/common/preferences.ts
Comment on lines +325 to +330
private getResourceCandidates(resource: URI): URI[] {
const candidates = [resource];
const path = resource.path;
if (path.endsWith('.json')) {
candidates.push(resource.with({ path: `${path.slice(0, -'.json'.length)}.jsonc` }));
}
Comment thread src/vs/workbench/services/configuration/common/configuration.ts
Comment on lines +109 to +112
if (!await this.fileService.exists(targetResource)) {
const jsoncAlternative = this.getJsoncAlternative(targetResource);
if (jsoncAlternative && await this.fileService.exists(jsoncAlternative)) {
targetResource = jsoncAlternative;
Comment thread src/vs/workbench/contrib/preferences/common/preferencesContribution.ts Outdated
Comment thread src/vs/workbench/contrib/extensions/browser/extensionsActions.ts Outdated
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 naming settings.json as settings.jsonc (and others)

6 participants