Warning about ${workspaceFolder} in OUTPUT/SonarLint

Operating system: Windows 10 (also seen on Linux)
SonarLint plugin version: v3.18.0
Programming language you’re coding in: does not matter
Is connected mode used: does not matter

And a thorough description of the problem / question:
I get a warning in the log. It seem to have no impact but it confused me searching for other issues:

[Warn - 07:52:44.065] Using ${workspaceFolder} variable in sonarlint.pathToCompileCommands is only supported for files in the workspace

My settings /workspaces/<repo_name>/.vscode/settings.json:
"sonarlint.pathToCompileCommands": "${workspaceFolder}/Build/compile_commands.json",
related:
"cmake.copyCompileCommands": "${workspaceFolder}/Build/compile_commands.json",

I am not sure what to make of this warning. I really dont get what it saying. I cannot use ${workspaceFolder} for file outside of it? Why would I use It then? Or is the location of the file where the settings are relevant? The location of the settings file is clearly in the worspace folder.

Hi @KUGA2 ,

Thank you for reporting this in our Community forum.

The settings you provided as an example should indeed not lead to the warning

“Using ${workspaceFolder} variable in sonarlint.pathToCompileCommands is only supported for files in the workspace”.

as the compiled.json file is in the workspace folder.

I can reproduce this locally and have created a ticket to fix this on our side. You can track the progress directly in the ticket.

Best,

Vojtech from :sonarlint:

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.