SonarLint for VSCode: C/C++ support

Hello,

Are there plans to add C/C++ language support the SonarLint plugin in VSCode ?

Thanks

Hello,

We don’t plan to add C/C++ support in VSCode this year. Can’t tell yet about the next one.

Hello,

Is there any update?

Thanks

Hi @n-mm,

not yet, sorry about that, what is clear is that its demand is increasing.

(I moved the thread to feature suggestion category so that interested people can vote for it)

Just to make everybody aware, the difficulty on our side is that our C/C++ analyzer needs to collect compilation properties (compiler flags/arguments/includes locations) to work properly.
When analyzing a project using the SonarQube scanner, we ask users to collect those informations using a build wrapper command line tool. This is not practical in SonarLint.

In SonarLint for Visual Studio, we are dynamically getting those information using Visual Studio APIs.

We haven’t started any investigation for now, but to achieve the same in VSCode, it is likely we will need to hook into the C/C++ VSCode extension. We might even depends on a collaboration with the C/C++ VSCode extension maintainers, so that they expose the informations to our extension.

1 Like

I see. I think you may look into the Intellisense support (specifically the C/C++ intellisense extension), that’s the location of “semantic” data of your program.

The intellisense is populated by various extensions that provide support for code editing. For example, if you use the CMake extension, it will tell Intellisense about various compilation flags (after the code has been built) so code navigation/completion is correct. You can reuse this information in SonarLint.