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

When code runner extension gets installed, disable the play button icon immediately #7616

Merged
merged 1 commit into from
Sep 26, 2019

Conversation

karrtikr
Copy link

@karrtikr karrtikr commented Sep 25, 2019

For #7613

@karrtikr karrtikr added the no-changelog No news entry required label Sep 25, 2019
@codecov-io
Copy link

codecov-io commented Sep 26, 2019

Codecov Report

Merging #7616 into master will decrease coverage by 0.32%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7616      +/-   ##
==========================================
- Coverage   58.68%   58.35%   -0.33%     
==========================================
  Files         493      493              
  Lines       21990    21989       -1     
  Branches     3531     3525       -6     
==========================================
- Hits        12905    12832      -73     
- Misses       8279     8351      +72     
  Partials      806      806
Impacted Files Coverage Δ
src/client/common/types.ts 100% <ø> (ø) ⬆️
src/client/terminals/activation.ts 83.87% <100%> (-0.98%) ⬇️
src/client/common/application/extensions.ts 50% <50%> (-10%) ⬇️
src/client/testing/serviceRegistry.ts 48.64% <0%> (-46.85%) ⬇️
src/client/testing/codeLenses/main.ts 44.44% <0%> (-33.34%) ⬇️
...t/datascience/jupyter/jupyterDataRateLimitError.ts 66.66% <0%> (-33.34%) ⬇️
src/client/formatters/serviceRegistry.ts 75% <0%> (-25%) ⬇️
src/client/common/utils/icons.ts 83.33% <0%> (-16.67%) ⬇️
src/client/api.ts 78.57% <0%> (-14.29%) ⬇️
src/client/datascience/cellFactory.ts 75.86% <0%> (-13.8%) ⬇️
... and 3 more

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 8bc45c3...7db0739. Read the comment docs.

const isInstalled = this.isCodeRunnerInstalled();
// Hide the play icon if code runner is installed, otherwise display the play icon.
this.commands.executeCommand('setContext', 'python.showPlayIcon', !isInstalled)
.then(noop, noop);
Copy link
Member

Choose a reason for hiding this comment

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

For my info. Why not await here?

Copy link
Author

Choose a reason for hiding this comment

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

executeCommand returns a thenable type object (by design), not a promise.
So although it's an async operation, we can't use await.

Choose a reason for hiding this comment

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

I'd say we can wait, but there's no need to wait. I.e. no point delaying other code when we don't care how long it takes to complete.

Copy link
Author

Choose a reason for hiding this comment

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

Wait, I just noticed we can do that, not sure why I didn't use it in the first place.

@karrtikr karrtikr merged commit 87e067c into microsoft:master Sep 26, 2019
@karrtikr karrtikr deleted the onChangeIcon branch September 26, 2019 06:41
@lock lock bot locked as resolved and limited conversation to collaborators Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants