Skip to content

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

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

DonJayamanne
Copy link

For #8869

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -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) {
Copy link
Author

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';
Copy link
Author

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-io
Copy link

codecov-io commented Feb 7, 2020

Codecov Report

Merging #9986 into master will decrease coverage by 0.03%.
The diff coverage is 17.39%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/client/datascience/types.ts 100% <ø> (ø) ⬆️
src/client/datascience/webViewHost.ts 60.83% <0%> (-0.87%) ⬇️
src/client/common/contextKey.ts 77.77% <0%> (-22.23%) ⬇️
...ient/datascience/interactive-ipynb/nativeEditor.ts 56.98% <0%> (ø) ⬆️
...atascience/interactive-window/interactiveWindow.ts 18.38% <0%> (ø) ⬆️
.../datascience/interactive-common/interactiveBase.ts 16.96% <0%> (ø) ⬆️
src/client/datascience/constants.ts 99.69% <100%> (ø) ⬆️
.../client/datascience/context/activeEditorContext.ts 19.04% <8.69%> (-10.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd24243...691df89. Read the comment docs.

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);
Copy link

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'

Copy link
Author

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.

Copy link
Author

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

Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

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

:shipit:

@DonJayamanne DonJayamanne merged commit a8d965b into microsoft:master Feb 7, 2020
@DonJayamanne DonJayamanne deleted the issue8869 branch February 7, 2020 20:56
@lock lock bot locked as resolved and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants