"Could not find input with command" pop up while trying the commandvariable's exemple
It's unlikely that this is related to 79 because that was closed 2 years ago.
Please indicate the version of the extension that you are using and your exact tasks.json.
Version is 1.15.0
The JSON is:
{
"version": "2.0.0",
"tasks": [
{
"label": "Get Option String",
"type": "shell",
"command": "echo \"The option string is '${input:getOptionString}' and the selection option is '${input:selectedOption}'\"",
"problemMatcher": []
}
],
"inputs": [
{
"id": "getOptionString",
"type": "command",
"command": "extension.commandvariable.transform",
"args": {
"key": "optionString",
"text": "${command:getOptionString}",
"command": {
"getOptionString": {
"command": "shellCommand.execute",
"variableSubstArgs": true,
"args": {
"command": "echo You selected ${pickStringRemember:pickAnOption}",
"useSingleResult": true,
},
"pickStringRemember": {
"pickAnOption": {
"key": "selectedOption",
"description": "Pick an option",
"options": [
{ "label": "Previous option:",
"value": "${remember:selectedOption}",
"description": "${remember:selectedOption}"
},
"Option A",
"Option B",
"Option C",
"Option D"
]
}
}
}
}
}
},
{
"id": "selectedOption",
"type": "command",
"command": "extension.commandvariable.remember",
"args": { "key": "selectedOption" }
}
]
}
It's unlikely that this is related to 79 because that was closed 2 years ago.
But, exactly this ticket is mentioned in the comment on the screenshot. And exactly in the resolveTaskToInput() the exception being thrown. In general, the resolveTaskToInput() is built in a very strange manner:
- It solves exactly one narrow task: to substitute the
${workspaceFolder}(only!) var if it was found in theinput. - It re-reads the source of the
input's instead of using of the given command and/or arguments. Furthermore, the criteria of that the command is found is the current command from an array is equal to the given one — whether two (or even more) equal commands cannot be defined?..
Though, of course, I can make a mistake because I came to these conclusions after a cursory acquaintance with the sources…
Hi @roussak. Thanks for your answer. I think the problem is some lack of support between commandvariable.transform and this extension. I'm not familiar with commandvariable.transform. What are you trying to do?
Could you please try adding a taskId to your shellCommand task?
Could you please try adding a
taskIdto your shellCommand task?
This gives nothing.
Please, review my PR (by the way, it allows the taskId using to solve the issue).