Tasks (and TaskExecutions) are not === in the onDid(Start|End)Task callbacks.
See original GitHub issue- VSCode Version: 1.44.2
- OS Version: macOS 10.5.4
Steps to Reproduce:
- Create a new extension using
yo code
. - Add the following to the ‘activate’ function body:
let disposable = vscode.commands.registerCommand('extension.helloWorld', async () => {
let echoTask = new vscode.Task({type: "taskbug"}, vscode.TaskScope.Workspace, 'echo', 'taskbug', new vscode.ProcessExecution('/bin/echo', ['hello world']));
const echoTaskExecution = await vscode.tasks.executeTask(echoTask);
vscode.tasks.onDidStartTaskProcess(e => {
if (e.execution === echoTaskExecution) {
console.log(`Detected that my task started with pid ${e.processId}`);
} else if (e.execution.task === echoTask) {
console.log(`Detected that my task started with pid ${e.processId}`);
}
});
vscode.tasks.onDidEndTaskProcess(e => {
if (e.execution === echoTaskExecution) {
console.log(`Detected that my task exited with exit code ${e.exitCode}`);
} else if (e.execution.task === echoTask) {
console.log(`Detected that my task exited with exit code ${e.exitCode}`);
}
});
});
- Run debug the extension and run the ‘Hello World’ command.
If you break inside the onDidStartTaskProcess and onDidEndTaskProcess that comparison fail, which means its difficult to determine when the task starts or ends.
It’s worth noting that in VSCode 1.43 the above comparisons both work, but in 1.44 this is not working.
Does this issue occur when all extensions are disabled?: Yes
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Assigning Tasks to Workers: Handling Assignment Callbacks
Learn how to handle Assignment Callbacks in TaskRouter, including parameters included in the HTTP POST request and ways to respond in your code....
Read more >Received unregistered task of type KeyError('modules ...
I'm trying to execute chains of task with celery, this is my tasks: from config import celery_app from modules.transaction.models import ...
Read more >Chaining tasks using continuation tasks | Microsoft Learn
Learn to chain task by using continuation tasks in .NET. A continuation task is an asynchronous task that's invoked by another task.
Read more >module folktale/concurrency/task
In order to combine callbacks, a user has to write code specific to each place ... Because Tasks abstract computations, and not values,...
Read more >Manage follow-up actions with the task list - IDEXX Neo
A task will not be created for an unmatched result. ... Use the Callbacks tab to create, view, and manage tasks to remind...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Added an API test.
Related to bug https://github.com/microsoft/vscode/issues/98080
I’ve also verified this change fixes that bug. Thanks 👍
@alexr00 can i ask why there are no tests for this change? it would be useful to add tests to prevent regressions.