-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Display commands when necessary #9986
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
Conversation
Kudos, SonarCloud Quality Gate passed!
|
@@ -398,7 +399,7 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp | |||
// it's been activated. However if there's no active text editor and we're active, we | |||
// can safely attempt to give ourselves focus. This won't actually give us focus if we aren't | |||
// allowed to have it. | |||
if (active && !this.viewState.active) { | |||
if (args.current.active && !args.previous.active) { |
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.
Changed this so that the state is update immediately.
The fact that something is active and it isn't reflected in its own state results in a bug in other parts of the code.
Modified to ensure we pass previous state for places that require it (this was the only place)
export const IsNativeActive = 'python.datascience.isnativeactive'; | ||
export const IsInteractiveOrNativeActive = 'python.datascience.isinteractiveornativeactive'; | ||
export const IsPythonOrNativeActive = 'python.datascience.ispythonornativeactive'; | ||
export const IsPythonOrInteractiveActive = 'python.datascience.ispythonorinteractiveeactive'; |
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.
Added some or
commands as its not possible to have or
conditions in the commands.
Codecov Report
@@ Coverage Diff @@
## master #9986 +/- ##
==========================================
- Coverage 61.2% 61.16% -0.04%
==========================================
Files 564 564
Lines 30083 30109 +26
Branches 4550 4555 +5
==========================================
+ Hits 18411 18416 +5
- Misses 10642 10663 +21
Partials 1030 1030
Continue to review full report at Codecov.
|
protected async onViewStateChanged(visible: boolean, active: boolean) { | ||
super.onViewStateChanged(visible, active); | ||
protected async onViewStateChanged(args: WebViewViewChangeEventArgs) { | ||
super.onViewStateChanged(args); | ||
|
||
// Update our contexts | ||
const interactiveContext = new ContextKey(EditorContexts.HaveNative, this.commandManager); |
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.
interactiveContext [](start = 14, length = 18)
should probably rename this. It's not the 'interactiveContext', but the 'nativeContext'
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.
Because CI sucks big time, I'll do it in the next PR.
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.
Fixed in another PR that I'll be submitting shortly
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.
For #8869