Skip to content

Implement per-workspace C/C++ configurations (#14363)#14366

Open
Subham-KRLX wants to merge 4 commits intomicrosoft:mainfrom
Subham-KRLX:feature/workspace-configurations
Open

Implement per-workspace C/C++ configurations (#14363)#14366
Subham-KRLX wants to merge 4 commits intomicrosoft:mainfrom
Subham-KRLX:feature/workspace-configurations

Conversation

@Subham-KRLX
Copy link
Copy Markdown
Contributor

This PR introduces the C_Cpp.configurations setting, allowing users to define C/C++ configurations directly within VS Code workspace or folder settings. This resolves #14363, where multiple workspaces sharing the same folder were forced to share a single c_cpp_properties.json file.

Key Changes

  • Precedence Logic: Updated the configuration parser to prioritize C_Cpp.configurations from settings over the local c_cpp_properties.json file.
  • Full Parity: The new settings-based configurations support the exact same schema, variable resolution (e.g., ${workspaceFolder}), and sanitization logic as the traditional file-based approach.
  • Reactive Updates: Integrated with onDidChangeSettings to ensure IntelliSense/Status Bar UI updates immediately when settings are modified.
  • Backward Compatibility: If the new setting is not present, the extension falls back to existing file-based behavior with no disruption.

Verification

  • Verified that workspace settings override local c_cpp_properties.json.
  • Verified fallback behavior when settings are cleared.
  • Confirmed that variable resolution remains consistent across both configuration sources.

Fixes #14363

@Subham-KRLX Subham-KRLX requested a review from a team as a code owner April 12, 2026 13:14
@github-project-automation github-project-automation bot moved this to Pull Request in cpptools Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pull Request

Development

Successfully merging this pull request may close these issues.

There is no way to set c_cpp_properties.json (with multiple configurations) per-workspace

1 participant