IDE name and flavor/env:
Visual Studio 2019
SonarLint plugin version:
*** Is connected mode used:**
Yes, to SonarQube.
Support for compilation database was announced last year. I’ve been trying to setup
sonar.cfamily.compile-commands=compile_commands.json based on the provided instructions.
Unfortunately, it seems like SonarLint is unable to support the project’s “configuration type”.
Connecting to '[....]'. Current VS version: Visual Studio Professional 2019 16.9.31129.286 16.9.3 Loaded settings from "C:\Users\[....]\AppData\Roaming\SonarLint for Visual Studio\settings.json". Connected to SonarQube '[....]'. Checking for suppressions... Number of suppressions found: 3 Initializing the telemetry package... Finished initializing the telemetry package... Initializing the notifications package... Loading notifications settings... Connected: checking for notifications Finished initializing the notifications package [Taint] Initializing taint issues synchronization package... [Taint] Fetched 0 taint vulnerabilities. [Taint] Finished initializing taint issues synchronization package. Initializing the daemon package... [Open in IDE] Creating request listener... [Open in IDE] Checking availability of port [....] [Open in IDE] Request listener created successfully. Listening on port [....]. Finished initializing the daemon package. **Project's "Configuration type" is not supported.** **Unable to retrieve the configuration for file '[....].cpp'.** ** Check the file is part of a supported project type in the current solution.** Checking for suppressions... Number of suppressions found: 3
I looked into the SonarLint source code. Based on my research it seems that two configuration options are supported:
In our case we are using Visual Studio’s NMake to trigger build commands on the CLI. It seems that that results in the “Configuration type” of our project not being recognised by SonarLint, even though the
sonar.cfamily.compile-commands is set.
Can anyone provide guidance on steps to take to get a Compilation Database to work in Visual Studio SonarLint when not using CMake?