-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] onDidEndTaskProcess event is not fired for plugins when task ends #8141
[Fix] onDidEndTaskProcess event is not fired for plugins when task ends #8141
Conversation
|
}); | ||
|
||
if (task && task instanceof ProcessTask && task.processType === 'process') { | ||
if (task && task instanceof ProcessTask) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (task instanceof ProcessTask)
should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it.
However, it is the same as in fireTaskCreatedEvent
method. Should I change it there too?
Signed-off-by: Tal Sapan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @RomanNikitenko, Thanks for the review. Thanks, |
@tal-sapan I'm going to merge the PR tonight for case if someone wants to review/test it today. |
Signed-off-by: Tal Sapan [email protected]
What it does
According to VSCode documentation, when a task ends, the events
onDidEndTask
andonDidEndTaskProcess
events are fired.onDidEndTaskProcess
is only fired for tasks that execute an underlying process.However, the
onDidEndTaskProcess
event is not fired in Theia.This PR fixes this issue by firing the event for all tasks of type
ProcessTask
.Note that the order of firing the two events is important:
onDidEndTaskProcess
must be fired first because whenonDidEndTask
is fired, the task execution is removed from the list of currently running task executions in$onDidEndTask
and not recognized in$onDidEndTaskProcess
:theia/packages/plugin-ext/src/plugin/tasks/tasks.ts
Line 78 in bc16fc1
How to test
vsix
I will attach in a comment).shell
orprocess
task, for example:LogTaskEndProcessEvent
output channel and see in the output:Task process ended with exit code 0: Hello World
Without this PR nothing is printed to the channel output.
Review checklist
Reminder for reviewers