IARSystems / iar-vsc-build

Visual Studio Code extension for developing and building IAR projects
Mozilla Public License 2.0
37 stars 5 forks source link

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

Open svantinio opened 2 months ago

svantinio commented 2 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 2 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.