gtest-adapter icon indicating copy to clipboard operation
gtest-adapter copied to clipboard

Configuration Program Variable Expansion

Open cassie-nahar opened this issue 4 years ago • 1 comments

The current implementation handles expanding the ${workspaceFolder} or ${workspaceRoot} variable manually, but cannot handle any other variables. When using the cmake-tools extension, it is advantageous to define the launch.json to use the ${command:cmake.launchTargetPath} variable as suggested in the developer's documentation. However, gtest-adapter is unable to handle that configuration.

I propose using VS Code's configurationResolver instead of manually trying to parse variables. This merge highlights the usage. The actual code that handles the resolution is here.

This would handle my use case and potentially many others. If I have time to play with it, I might do so and put a pull request. But I'm not sure how long that will be.

cassie-nahar avatar Sep 11 '20 17:09 cassie-nahar

The default launch.json uses ${fileDirname}, which also won't get expanded. I agree resolving all variables would be the best thing to do instead of a small list of variables

shimpossible avatar Sep 19 '21 14:09 shimpossible