Skip to content

Conversation

Colengms
Copy link
Contributor

@Colengms Colengms commented Apr 3, 2025

Aligns some hard-coded default file associations with the defaults on the native side. (There is a separate native PR for fixes there).

Fixes a bug where .C may be considered a C source file (uppercase implies C++).

Correctly considers .i a C source file, and .ii a C++ source file. Added missing header type: .tlh, .tli

Moves .tcc to the list of header files instead of source files.

Not addressed by this PR: These functions should also consider the contents of files.assocations (at least for source file types, as that does not distinguish between headers and sources).

@github-project-automation github-project-automation bot moved this to Pull Request in cpptools Apr 3, 2025
@Colengms Colengms marked this pull request as ready for review April 3, 2025 20:26
@Colengms Colengms requested a review from a team as a code owner April 3, 2025 20:26
@bobbrow
Copy link
Member

bobbrow commented Apr 3, 2025

Correctly considers .i a C source file,

Is this universally true? I recently preprocessed a .cpp file with MSVC and it spit out a .i for me.

@Colengms
Copy link
Contributor Author

Colengms commented Apr 3, 2025

Correctly considers .i a C source file,

Is this universally true? I recently preprocessed a .cpp file with MSVC and it spit out a .i for me.

It looks like MSVC incorrectly copied the convention from GCC/clang, and doesn't properly use .ii for C++ sources. However, if you look at the native PR, at the changes in settings.h, you'll see that we were already considering .i a C file. (Apparently because VS Code itself considers .i a C source file, which you can confirm by opening one).

@bobbrow
Copy link
Member

bobbrow commented Apr 3, 2025

It looks like MSVC incorrectly copied the convention from GCC/clang, and doesn't properly use .ii for C++ sources. However, if you look at the native PR, at the changes in settings.h, you'll see that we were already considering .i a C file. (Apparently because VS Code itself considers .i a C source file, which you can confirm by opening one).

I'm not particularly worried about it since I don't think there are any existing bugs asking for different behavior. It seems to be an uncommon scenario.

@Colengms Colengms merged commit b73353f into main Apr 3, 2025
6 checks passed
@Colengms Colengms deleted the dev/coleng/fix_file_assocations branch April 3, 2025 23:04
@github-project-automation github-project-automation bot moved this from Pull Request to Done in cpptools Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants