Skip to content
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

Remote 'kernelCommandListener' as it really listens to notebooks #10369

Merged
merged 8 commits into from
Jun 8, 2022

Conversation

rchiodo
Copy link
Contributor

@rchiodo rchiodo commented Jun 8, 2022

For #10152

Another step in the removal of the 'notebook' references in kernels. The KernelCommandListener class was really listening to commands on notebooks so I just moved it.

@rchiodo rchiodo requested a review from a team as a code owner June 8, 2022 17:57
Commands.NotebookEditorInterruptKernel,
(context?: { notebookEditor: { notebookUri: Uri } } | Uri) => {
if (context && 'notebookEditor' in context) {
void this.interruptKernel(context?.notebookEditor?.notebookUri);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you swallow the promise rejections using .ignoreErrors or .catch(noop)
as follows:

this.interruptKernel(context?.notebookEditor?.notebookUri).catch(noop);
// or
this.interruptKernel(context?.notebookEditor?.notebookUri).ignoreErrors();

Using void doesn't really handle the errors, hence if something fails we get errors logged by node.js about unhandled errors and this causes a few issues when debugging and the like.
Will mention at standup today.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. This was already there, but I can fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a linter rule.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or I can just search for 'void this' everywhere and fix it.

Copy link
Contributor

@DonJayamanne DonJayamanne Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got a PR for that, will mention in standup.

@rchiodo
Copy link
Contributor Author

rchiodo commented Jun 8, 2022

@DonJayamanne did you have any more feedback?

@DonJayamanne
Copy link
Contributor

Not sure why i didn't approve, sorry

@rchiodo rchiodo merged commit 1f1105b into main Jun 8, 2022
@rchiodo rchiodo deleted the rchiodo/kernels_no_notebook_5 branch June 8, 2022 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants