You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft, please do support for variable that holds current configuration name selected from cpp_property.json file for Visual Studio and Visual Code available in tasks This for example be: ${configurationName}. This is very needed and I wonder why you didn't do that (maybe did?) Do that should be simple update so please to make this.
I don't think extensions have a way of adding task variables, so someone would need to get VS Code to add this ability. You may be able to work around this by using an environment variables of the form ${env:configurationName} and then somehow changing the value of the environment variable when a configuration changes, such as via adding code in onSelectedConfigurationChanged in https://github.com/Microsoft/vscode-cpptools/blob/master/Extension/src/LanguageServer/client.ts , but if we want this change to be shipped in the product, it seems like the name of the environment variable would need to be a setting so that it's customizable.
This can be implemented in our open source code via adding a C_Cpp.configuration setting and the using ${config.C_Cpp.configuration} in your task.json. The config index is currently saved in the workspace "persistent state". I agree it would be good to add, but I'm not sure when we'll get around to it yet due to higher priority tasks.
On Fri, Jan 26, 2018 at 2:16 AM, Sean McManus ***@***.***> wrote:
This can be implemented in our open source code via adding a
C_Cpp.configuration setting and the using ${config.C_Cpp.configuration} in
your task.json. The config index is currently saved in the workspace
"persistent state". I agree it would be good to add, but I'm not sure when
we'll get around to it yet due to higher priority tasks.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1444 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKwVo0Cno36ZTqNn3WGGn7jqHX0OnljZks5tOSd4gaJpZM4RdKuN>
.
Activity
sean-mcmanus commentedon Jan 16, 2018
I don't think extensions have a way of adding task variables, so someone would need to get VS Code to add this ability. You may be able to work around this by using an environment variables of the form ${env:configurationName} and then somehow changing the value of the environment variable when a configuration changes, such as via adding code in onSelectedConfigurationChanged in https://github.com/Microsoft/vscode-cpptools/blob/master/Extension/src/LanguageServer/client.ts , but if we want this change to be shipped in the product, it seems like the name of the environment variable would need to be a setting so that it's customizable.
sean-mcmanus commentedon Jan 26, 2018
This can be implemented in our open source code via adding a C_Cpp.configuration setting and the using ${config.C_Cpp.configuration} in your task.json. The config index is currently saved in the workspace "persistent state". I agree it would be good to add, but I'm not sure when we'll get around to it yet due to higher priority tasks.
witM commentedon Jan 26, 2018
bobbrow commentedon Sep 9, 2019
You can use
${command:cpptools.activeConfigName}to get the value of the active configuration. Is that what you were asking for?