iarsystems / iar-vsc-build

Visual Studio Code extension for developing and building IAR projects
https://marketplace.visualstudio.com/items?itemName=iarsystems.iar-build
Mozilla Public License 2.0
38 stars 5 forks source link

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

Closed svantinio closed 6 days ago

svantinio commented 7 months ago

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:

HampusAdolfsson commented 7 months ago

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.