DavidSchuldenfrei / gtest-adapter

Other
18 stars 9 forks source link

Configuration Program Variable Expansion #56

Open cassie-nahar opened 4 years ago

cassie-nahar commented 4 years ago

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.

shimpossible commented 3 years ago

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