You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing a task with a custom type (through a task provider, tasks.json or by creating a new Task instance and calling tasks.executeTask), the value of task.definition.type is different from the returned execution's execution.task.definition.type. For example, for a custom task that has a ShellExecution, the type becaomse shell. The original type is in the property taskType of the task.
This is different from the behavior in VSCode, where task.definition.type is the original type and taskType is not defined.
This makes it hard for extensions that listen to the task end event to determine the type of the task that ended. The difference is also not documented as far as I saw, so it could be a problem to rely on it, as it seems like a sort of internal property.
You can see the difference in behavior in an extension I created. It contributes a task definition, registers a task provider and contributes a command that creates the task and executes it, then shows an information message with both fields. It also listens to the task end event and shows the same message about the ended task.
Build the extension above using npm install && npm run package
Open Theia with this extension
From the command palette run the command Run my-hello task
The task opens a terminal and prints Hello User!. Then it shows the task and taskType properties returned from the task execution returned from executeTask and the onDidEndTask event. Expected behavior: the task property contains the original task type - hello-task, and the taskType property is undefined. Actual behavior: the type property contains the value shell and the taskType property contains the hello-task value.
Additional Information
Operating System: Windows 10 (also tested on a Linux system)
Theia Version: built from master (also tested on Theia 1.7.0 and 1.8.0)
The text was updated successfully, but these errors were encountered:
Bug Description:
When executing a task with a custom type (through a task provider, tasks.json or by creating a new
Task
instance and callingtasks.executeTask
), the value oftask.definition.type
is different from the returned execution'sexecution.task.definition.type
. For example, for a custom task that has aShellExecution
, thetype
becaomseshell
. The original type is in the propertytaskType
of the task.This is different from the behavior in VSCode, where
task.definition.type
is the original type andtaskType
is not defined.This makes it hard for extensions that listen to the task end event to determine the type of the task that ended. The difference is also not documented as far as I saw, so it could be a problem to rely on it, as it seems like a sort of internal property.
You can see the difference in behavior in an extension I created. It contributes a task definition, registers a task provider and contributes a command that creates the task and executes it, then shows an information message with both fields. It also listens to the task end event and shows the same message about the ended task.
This is how it looks in VSCode:
This is how it looks in Theia:
Relevant definitions in the
package.json
file:The task provider:
The command:
The task end event listener:
You can find the full implementation here: https://github.com/tal-sapan/tasktype
Steps to Reproduce:
npm install && npm run package
Run my-hello task
Hello User!
. Then it shows thetask
andtaskType
properties returned from the task execution returned fromexecuteTask
and theonDidEndTask
event. Expected behavior: thetask
property contains the original task type -hello-task
, and thetaskType
property is undefined. Actual behavior: thetype
property contains the valueshell
and thetaskType
property contains thehello-task
value.Additional Information
The text was updated successfully, but these errors were encountered: