Skip to content

Display commands when necessary#9986

Merged
DonJayamanne merged 1 commit into
microsoft:masterfrom
DonJayamanne:issue8869
Feb 7, 2020
Merged

Display commands when necessary#9986
DonJayamanne merged 1 commit into
microsoft:masterfrom
DonJayamanne:issue8869

Conversation

@DonJayamanne

Copy link
Copy Markdown

For #8869

@sonarqubecloud

sonarqubecloud Bot commented Feb 7, 2020

Copy link
Copy Markdown

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

// 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
Copy Markdown
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
Copy Markdown
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

codecov-io commented Feb 7, 2020

Copy link
Copy Markdown

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.

super.onViewStateChanged(args);

// Update our contexts
const interactiveContext = new ContextKey(EditorContexts.HaveNative, this.commandManager);

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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

@rchiodo rchiodo left a comment

Copy link
Copy Markdown

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