Skip to content

Conversation

@sean-mcmanus
Copy link
Contributor

@sean-mcmanus sean-mcmanus commented Jan 7, 2026

This change addresses item microsoft/vscode-cpptools#14126

...although we intended to do an additional fix on the cpptools side as well to prioritize using compilerFragments from the associated source file for headers instead of the header compilerFragments.

This changes [[visible behavior]]

The following changes are proposed:

For header file groups with no compilerFragments, it using the invalid compilerFragments for RC files instead of C/C++ files.

Other Notes/Information

I tested the fix:

  • Manually, using the VS vc repo (repros when opening a header file in the vscode/cpptools folder).
    • I confirmed the header files get the C++ compiler fragments.
    • I confirmed that .rc files still get the RC compiler fragments (CMake itself appears to set them by default).
  • With the added unit test case.
    • I confirmed it fails without the fix and passes with it.

Unfixed cases:

  • Header files intended for C files might still get compilerFragments for C++ files. Not a regression and seems rare and low priority.

@hanniavalera hanniavalera merged commit 534bcc9 into main Jan 8, 2026
4 checks passed
@hanniavalera hanniavalera deleted the seanmcm/fixHeaderFilesGettingCompileFragmentsFromRC branch January 8, 2026 20:28
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.

3 participants