Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot force IntelliSense file associations to cpp for .c files #76

Open
svantinio opened this issue Apr 8, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@svantinio
Copy link

Describe the bug:
I've a large legacy codebase that for some reason is mostly compiled with a c++ compiler but uses .c/.h file endings for a majority of the files. When having the IAR-build as configuration provider I cannot force intellisense to use c++ file association for .c files.

To Reproduce:
In a project which uses the c++ compiler, add a .c file.
Add file associations for *.c files to cpp in settings.json.

Expected behavior:
That the extesion parses the file as a c++ file.

Actual behavior:
Language mode is set to C.
In the C/C++ output, when opening the .c file, stdver is set to c17 instead of c++17.

Environment:

  • OS: Windows
  • Embedded Workbench: Arm
  • Embedded Workbench version: 9.2
  • VSC Extension version: v1.30.6
@svantinio svantinio added the bug Something isn't working label Apr 8, 2024
@HampusAdolfsson
Copy link
Collaborator

Thanks for reporting this!

With the fix coming in the next release, we'll use preprocessor defines instead of file extensions to determine the language of a file. Then, there should be no need for you to manually define file associations, and VS Code's language mode should be automatically set to match what you've set in your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants