Add support for variable ${workspaceFolderBasename} and config namespace
See original GitHub issueVisual studio has several predefined variables: https://code.visualstudio.com/docs/editor/variables-reference, which they unfortunately don’t support in settings.json for some reason. Extensions can support them. This Extension does support some of them. But one is I need is missing (it has a different name). It also uses a different namespace: command:
instead of config:
I would like support for ${workspaceFolderBasename}. The alternative is workspaceName, but I like to be consistent in my settings.json file. I use ${workspaceFolderBasename} in multiple json files.
Example
{
"cmake.buildDirectory": "${workspaceFolder}/../build-${workspaceFolderBasename}",
"testMate.cpp.test.workingDirectory": "${command:cmake.buildDirectory}",
"testMate.cpp.test.executables": "${command:cmake.buildDirectory}/${workspaceName}_test.exe",
}
I would prefer it like this:
{
"cmake.buildDirectory": "${workspaceFolder}/../build-${workspaceFolderBasename}",
"testMate.cpp.test.workingDirectory": "${config:cmake.buildDirectory}",
"testMate.cpp.test.executables": "${config:cmake.buildDirectory}/${workspaceFolderBasename}_test.exe",
}
Thus I want workspaceFolderBasename supported and I want config:
to work too. I use config:
notation also in tasks.json and launch.json. For example:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Nucleo openocd",
"cwd": "${workspaceFolder}",
"executable": "${config:cmake.buildDirectory}/${workspaceFolderBasename}.elf",
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
${workspaceFolderBasename}
can be achieved with${workspaceFolder[-1]}
. Config is cool. I’m adding itI think the
command
is basically resolved on the cmake extension’s code. VSCode does not provide an api for variable resolution, I can just query the configs. Every extension provide their own resolution. Now I added some recursion but I’m not a fan of it. I wouldn’t suggest you to depend on a lot but you can try out.