Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Use correct resolved TDO and task for custom execution #77759
This address issue #77757.
When using custom executions in conjunction with resolved tasks, the wrong variables where being passed to addCustomExecution and addCustomExecution2. They needed to be passed the resolvedDTO and the resolvedTask.
This change was verified by ensuing that task resolution works correctly after modifying a default build task in tasks.json for our internal MS extension. Both "terminal renderer" and "virtual terminal process" paths were verified.
I think I’m confused on what resolveTask is supposed to do (hence issue #77759).
What we can do in our resolveTask is essentially return as “new task” as long as the task information passed to “resolve task” is something we can execute.
Is the intention of “resovleTask” to resolve it to something that the provider provided during “provideTasks” (i.e. an already existing task?).
I guess what I’m super confused about is should the user EVER be able to edit tasks.json? If they do, then how would a task there ID ever match what is returned through “provideTasks”?
Our task provider can actually resolve to a new task with no problems as long as the edits to task.json match our schema, which VSCode happily guides the user through if your task definition information is correct in the package.json for the extension
Please help me understand
tasks.json is for modifying non-provider specific task properties. If a task provider defines a property for their task in their package.json, then those properties are immutable for that task. We use them as an ID of the task so it needs to be consistent. Things like background, presentation, and group are all fair game to be modified in tasks.json.
This confusion over what
alexr00 left a comment
We talked about this some more, and the goal of this change isn't to change the task definition (which is dangerous because it changes the task's ID). All that's needed in addition what's already here is a check that the task definition hasn't changed.