Skip to content

Run shellCommand to transform value in remember #50

Description

@tcm0116

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 in selectedBazelTarget), and then the the result of that selection is then run through another shell command to get a different value (which gets stored in selectedBazelTargetPath). Is there a way to do something like this?

 "inputs": [
{
"id": "pickBazelTarget",
"type": "command",
"command": "extension.commandvariable.pickStringRemember",
"args": {
"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": "bazelTargetPath",
"type": "command",
"command": "extension.commandvariable.remember",
"args": {
"key": "selectedBazelTargetPath",
"command": {
"getBazelTargetPath": {
"command": "shellCommand.execute",
"args": {
"command": "bazel cquery --config=${command:cpptools.activeConfigName} --compilation_mode=dbg --output=files ${input:pickBazelTarget}",
"cwd": "${workspaceFolder}"
}
}
}
}
}
]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions