DavidSchuldenfrei/gtest-adapter

Configuration Program Variable Expansion

Opened this issue · 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.

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