-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run shellCommand to transform value in remember #50
Comments
@tcm0116 "inputs": [
{
"id": "bazelTargetPath",
"type": "command",
"command": "extension.commandvariable.transform",
"args": {
"key": "selectedBazelTargetPath",
"text": "${command:getBazelTargetPath}",
"command": {
"getBazelTargetPath": {
"command": "shellCommand.execute",
"variableSubstArgs": true,
"args": {
"command": "bazel cquery --config=${command:cpptools.activeConfigName} --compilation_mode=dbg --output=files ${pickStringRemember:pickBazelTarget}",
"cwd": "${workspaceFolder}"
},
"pickStringRemember": {
"pickBazelTarget" : {
"description": "Choose a target",
"key": "selectedBazelTarget",
"rememberTransformed": true,
"options": [
[ "Previous Target", "${remember:selectedBazelTarget}" ],
[ "Select target", "${command:bazelTargets}" ]
],
"command": {
"bazelTargets": {
"command": "shellCommand.execute",
"args": {
"command": "bazel query 'kind(cc_binary*, //...)'",
"cwd": "${workspaceFolder}"
}
}
}
}
}
}
}
}
}
] I have to implement the argument |
@rioj7 - in conjunction with the changes in #54, I was able to get your suggestion to work with the following {
"version": "2.0.0",
"tasks": [
{
"label": "Pick Bazel Target",
"type": "shell",
"command": "echo ${input:bazelTargetPath} ${input:selectedBazelTarget}"
}
],
"inputs": [
{
"id": "bazelTargetPath",
"type": "command",
"command": "extension.commandvariable.transform",
"args": {
"key": "selectedBazelTargetPath",
"text": "${command:getBazelTargetPath}",
"command": {
"getBazelTargetPath": {
"command": "shellCommand.execute",
"variableSubstArgs": true,
"args": {
"command": "bazel cquery --config=${command:cpptools.activeConfigName} --compilation_mode=dbg --output=files ${pickStringRemember:pickBazelTarget}",
"useSingleResult": true,
"cwd": "${workspaceFolder}",
"pickStringRemember": {
"pickBazelTarget": {
"description": "Choose a target",
"key": "selectedBazelTarget",
"rememberTransformed": true,
"options": [
[
"Previous Target",
"${remember:selectedBazelTarget}"
],
[
"Select target",
"${command:bazelTargets}"
]
],
"command": {
"bazelTargets": {
"command": "shellCommand.execute",
"args": {
"command": "bazel query 'kind(cc_binary*, //...)'",
"cwd": "${workspaceFolder}"
}
}
}
}
}
}
}
}
}
},
{
"id": "selectedBazelTarget",
"type": "command",
"command": "extension.commandvariable.transform",
"args": {
"text": "${remember:selectedBazelTarget}"
}
}
]
} |
@tcm0116 v1.49.0 use the syntax of comment You can use the following "options": [
{ "label": "Previous Target:",
"value": "${remember:selectedBazelTarget}",
"description": "${remember:selectedBazelTarget}"
},
{ "label": "Select target...", "value": "${command:bazelTargets}" },
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a follow-up to the suggestion provided in #45 (comment), I'm trying to determine if there's a way to use a shell command to transform the value stored in a remember. Below is an example of what I'm looking to do. In this situation, the idea is that the launch configuration would call
${input:bazelTargetPath}
, which would end up prompting the user to select a bazel target (which gets stored inselectedBazelTarget
), and then the the result of that selection is then run through another shell command to get a different value (which gets stored inselectedBazelTargetPath
). Is there a way to do something like this?The text was updated successfully, but these errors were encountered: