Is there a way to pre-pend or post-pend a VSCode command C_Cpp.ConfigurationSelect before/after a tasks.json task has been run? #13307
-
I currently have a
For release builds, I have a different task:
Corresponding to a debug or release code that I am working on/going to run, I have corresponding configurations in
Currently, I manually choose either of these configurations (via VSCode command Is there a way to pass the VSCode command of having the This is possibly related to this issue or this but these issues are so many years apart and it is not clear to me if there is a command that does take an optional parameter to set the active configuration. Is the following a syntactically correct
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
No, I wouldn't expect that command to work. You can't set a VS Code setting with a shell command. Maybe I'm missing something, but have you tried using the CMake Tools extension? Your configuration command seems simple enough that that extension should be able to get things right for you without any special configuration. That extension will also set up the IntelliSense configurations automatically for you to align with your current build type (Debug vs. Release). The configuration would look like this: {
"name": "LC",
"configurationProvider": "ms-vscode.cmake-tools"
} And you can either use tasks (the is a "cmake" task type) or commands to start a build. |
Beta Was this translation helpful? Give feedback.
You can take a look at "input" variables and try a "command" type. The name of the argument for this command is "configurationName", but the command itself returns void so I don't know if you'll run into trouble with the shell task when it resolves this type of variable.