This is very similar to VS Code cannot find similar task, only the last one but the answerer there can't reproduce, and I have a different task set up... so this could be a different issue.
Here is my tasks.json
(more or less):
{
"version": "2.0.0",
"inputs": [
{
"type": "pickString",
"id": "locale",
"description": "Which localisation should be used in this task",
"options": ["british", "american", "canadian"],
"default": "british",
}
],
"tasks": [
{
"label": "localise",
"script": "localise:make",
"options": { "env": { "NODE_ENV": "test", "PROJECT_UI_LOCALISATION": "${input:locale}" } },
"type": "npm",
},
{
"label": "localise:british",
"script": "localise:make",
"options": { "env": { "NODE_ENV": "test", "PROJECT_UI_LOCALISATION": "british" } },
"type": "npm",
},
{
"label": "localise:american",
"script": "localise:make",
"options": { "env": { "NODE_ENV": "test", "PROJECT_UI_LOCALISATION": "american" } },
"type": "npm",
},
{
"label": "localise:canadian",
"script": "localise:make",
"options": { "env": { "NODE_ENV": "test", "PROJECT_UI_LOCALISATION": "canadian" } },
"type": "npm",
}
]
}
When I press ctrl+shift+P and click Tasks: run tasks
, only the last one appears. When I try to run one of these via my launch.json
(with "preLaunchTask": "localise:${input:locale}"
and "postDebugTask": "localise:british"
, and a matching pickString
set of options I've re-defined/copy and pasted.) it can't find localise:british
twice (once in the preLaunchTask
if I select it from the drop down in vscode, and another in the postDebug
.)
Why is that, and how can I get around it?