Open notskm opened 4 years ago
For projects that aren't using a compilation database, this would be very helpful. When setting up include paths, if I treated paths relative to the folder holding the *.code-workspace file then I'm able to get a working setup, or at least something that appears to work.
I'm using "-I${workspaceFolder}/some/path"
in Windows and it seems to work
I tried that at first but it didn't find any headers. Curious! I'll try it again.
That's interesting. For unkwon reason it was working, BUT the extension log shows:
C:/projects/tools/LLVM-8.0.1-win64/bin/clang-tidy c:\path\to\tests.h --export-fixes=- --extra-arg-before=-x --extra-arg-before=c++ --extra-arg-before=-I --extra-arg-before=${workspaceFolder}/some/path
As you can see, clang-tidy
is called with the literal "${workspaceFolder}" and not the workspace path
So at this point I don't know what's happening
FYI, I don't believe I don't believe variables are resolved for you in settings. It looks like an API is in progress to allow extensions to resolve variables, but until that's done you can copy the needed bits from https://github.com/microsoft/vscode/blob/master/src/vs/workbench/services/configurationResolver/common/variableResolver.ts
For buildPath
, it seems you can use relative paths as a workaround. So instead of ${workspaceFolder}/build
you can use build
.
A quick update It looks like the API change that @joelspadin mentioned has been completed (see https://github.com/microsoft/vscode/issues/81007#issuecomment-680034293).
Any update on this issue? Without this feature, I am essentially unable to use clang-tidy at all in my setup (cmake with build directories never below the source directory). It seems quite essential to me.
Certain settings like
clang-tidy.buildPath
should support variables like${workspaceFolder}
.