-
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
Implement CancellationToken logic for withProgress API #11027
Implement CancellationToken logic for withProgress API #11027
Conversation
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.
Thanks for the contribution, @matt-dot! I believe this is working well. The extraneous TASKS_MAIN
should be removed (I think), and it would be helpful to update the testing instructions:
Add a console.log checking the value of token.isCancellationRequested
Add a console.log
where? In my testing it, I added it to the setTimeout
callbacks here, but the instructions should provide more detail.
Run and press the cancel button contained in the notification
Run what? I assume the extension's 'Show Progress' command.
Yes your assumptions are correct and I have amended the instructions. I'll be sure to be more detailed and specific in the future 👍 |
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.
LGTM, thanks for the contribution!
Signed-off-by: Matthew Langley <[email protected]>
Signed-off-by: Matthew Langley <[email protected]>
Signed-off-by: Matthew Langley <[email protected]>
Signed-off-by: Matthew Langley <[email protected]>
2ffc1fc
to
b4fbe3f
Compare
What it does
token.onCancellationRequested
&token.isCancellationRequested
(from the VS Code Extension API)How to test
console.log
within thesetTimeout
callbacks here to check the value oftoken.isCancellationRequested
showProgress
command (using the command pallette) and press the cancel button contained in the notificationtoken.onCancellationRequested
token.isCancellationRequested
remains false indefinitelytoken.onCancellationRequested
token.isCancellationRequested
changes based on button pressReview checklist
Reminder for reviewers
Signed-off-by: Matthew Langley [email protected]