-
Notifications
You must be signed in to change notification settings - Fork 297
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
Interrupt kernel button on interactive window toolbar should be disabled when kernel is not busy #7488
Conversation
…led when kernel is not busy
Codecov Report
@@ Coverage Diff @@
## main #7488 +/- ##
=====================================
Coverage 64% 64%
=====================================
Files 361 362 +1
Lines 22506 22536 +30
Branches 3422 3429 +7
=====================================
+ Hits 14589 14638 +49
+ Misses 6694 6679 -15
+ Partials 1223 1219 -4
|
@@ -100,24 +115,28 @@ export class ActiveEditorContextService implements IExtensionSingleActivationSer | |||
private onDidChangeActiveInteractiveWindow(e?: IInteractiveWindow) { | |||
this.interactiveContext.set(!!e).ignoreErrors(); | |||
this.updateMergedContexts(); | |||
this.updateContextOfActiveInteractiveWindowKernel(); | |||
} |
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.
You can use vscode built in context variable notebookCellExecuting
That'll be easier (less code) and more responsive
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.
Should we adopt that for the notebook editor as well then?
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 just tried it out, that context key only works when you set focus to the notebook cell that is executing. I don't think that will work for our use case.
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.
Try this notebookHasRunningCell
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.
That wouldn't work well too, e.g. if a notebook and IW are open side by side, running a cell in a notebook will cause the interrupt button in the IW toolbar to light up, and vice versa. Also in the IW case, since the IW may not actually be active (focus may be in the Python file), that would cause issues as well. The current implementation still suffers from this limitation #7487 for SxS IWs, but at least allows us to ensure that the IW toolbar is enabled correctly based on the active #%% file or active IW, and to ensure that IWs' and notebooks' run state doesn't affect the toolbar button enablement for each other.
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.
yuck, agreed.
Fix #7269