Closed ahfakt closed 2 weeks ago
Hey... Things have been hectic at home and it can take a while until I can take a look on this... Please be patient and thanks for understanding
Main goal is remembering across launch inputs and other task inputs(build and then debug some module). 'useRememberedValue' option would be a good feature on top of this. Can be discussed about different delimiter, prefix/suffix. It was a quick suggestion.
Is this necessary? Can't you just give multiple tasks the same taskId? This example uses the same remembered value for both inputs for me:
{
"version": "2.0.0",
"tasks": [
{
"label": "Task 1",
"type": "shell",
"command": "echo ${input:input1}",
"problemMatcher": []
},
{
"label": "Task 2",
"type": "shell",
"command": "echo ${input:input2}",
"problemMatcher": []
},
],
"inputs": [
{
"id": "input1",
"type": "command",
"command": "shellCommand.execute",
"args": {
"taskId": "thesame",
"command": "cat ${file}",
"cwd": "${workspaceFolder}",
"rememberPrevious": true
}
},
{
"id": "input2",
"type": "command",
"command": "shellCommand.execute",
"args": {
"taskId": "thesame",
"command": "cat ${file}",
"cwd": "${workspaceFolder}",
"rememberPrevious": true
}
}
]
}
The problem occurs when the same taskId is used in different groups of inputs. Launch inputs, workspace task inputs, user task inputs. That was the problem, I don't know if it still exists.
For me it's working across launch and tasks.
tasks.json
:
{
"version": "2.0.0",
"tasks": [
{
"label": "Echo Project File",
"type": "shell",
"command": "echo ${input:taskInput}",
"problemMatcher": []
}
],
"inputs": [
{
"id": "taskInput",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "cat ${file}",
"taskId": "thesame",
"rememberPrevious": true,
}
}
]
}
launch.json
:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch configuration",
"request": "launch",
"program": "echo ${input:launchInput}",
"args": [],
}
],
"inputs": [
{
"id": "launchInput",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "cat ${file}",
"taskId": "thesame",
"rememberPrevious": true,
}
}
]
}
If you still experience this in 1.11.0 or later, then please open an issue. This is a bug.
Please try 1.12.0
Different tasks can share same memory to remember by using until last '.' of the inputId parameter.