Skip to content

Provide Run Selection button in Editor Title Menu #2224

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

Conversation

jpogran
Copy link

@jpogran jpogran commented Oct 3, 2019

PR Summary

This adds a editor title menu button for the powershell.RunSelection command in the primary navigation group, and the run icon from the https://github.com/microsoft/vscode-icons repo.
This shows the button in the visible part of the menu when a PowerShell file is open.

This PR is marked as WIP because the icon chosen is the closest approximation I could find in the vscode suggested icon library, but if there is another one that is preferred I can change it to that.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests NA
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

This PR fixes #2215

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Oct 5, 2019

@jpogran can you use these svgs (there's a light and dark)?
play.zip

They look like this:
image

I got some help from @isabelacmor mashing the vscode icons together 😅

@jpogran jpogran force-pushed the gh-2215-run-selection-button branch from 7c1ad00 to cfde9ff Compare October 5, 2019 02:17
@jpogran
Copy link
Author

jpogran commented Oct 5, 2019

Updated with the new icon. Nice work 😄

image

@jpogran jpogran changed the title WIP: Provide Run Selection button in Editor Title Menu Provide Run Selection button in Editor Title Menu Oct 5, 2019
@TylerLeonhardt
Copy link
Member

Looks good! Hmm I'm thinking it might be nice to have another button to the left of it that's just the play button, just like the ISE. That can just launch the debugger since that's what F5 does today.

@rjmholt @SydneyhSmith what do you think?

@rjmholt
Copy link
Contributor

rjmholt commented Oct 5, 2019

what do you think?

Agreed!

@rjmholt
Copy link
Contributor

rjmholt commented Oct 5, 2019

I still need to checkout this branch and take a look at it, but it looks good so far!

@TylerLeonhardt
Copy link
Member

@jpogran is that something you're interested in taking on? You can just use the play button you had previously and then just look up the command that it needs to execute to start debugging.

Let me know if you need help finding the command. I typically find it on the keybinding menu by hovering over the keybinding.

@jpogran
Copy link
Author

jpogran commented Oct 7, 2019

Sure, will hook that up tomorrow

This commit adds a editor title menu button for the
`powershell.RunSelection` command in the primary navigation group, and
a custom `play` icon based on ones from the
https://github.com/microsoft/vscode-icons repo. This shows the button
in the visible part of the menu when a PowerShell file is open.
@jpogran jpogran force-pushed the gh-2215-run-selection-button branch from cfde9ff to 99e08fd Compare October 7, 2019 14:40
@jpogran
Copy link
Author

jpogran commented Oct 7, 2019

@TylerLeonhardt I registered the command in the Console.ts file because I couldn't think of a better place to put it. I figured it made sense to be next to Run Selection. Let me know if you want the location changed

@SydneyhSmith
Copy link
Collaborator

@jpogran this is looking great to me, thanks for the work!

package.json Outdated
@@ -161,10 +161,23 @@
},
"category": "PowerShell"
},
{
"command": "PowerShell.Run",
Copy link
Member

Choose a reason for hiding this comment

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

@jpogran is there a reason this can't just be workbench.action.debug.start?

Copy link
Author

Choose a reason for hiding this comment

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

No, I just had it in my head you need to make a command for anything you were going to use 😅 . Works fine as you suggest

This commit adds a editor title menu button for the
`powershell.Run` command which maps to the builtin VS Code Debug start
command. It places it in the primary navigation group, and
the uses `run` icon from the https://github.com/microsoft/vscode-icons
repo. This shows the button in the visible part of the menu when a
PowerShell file is open.
@jpogran jpogran force-pushed the gh-2215-run-selection-button branch from 99e08fd to 5905089 Compare October 7, 2019 16:51
@TylerLeonhardt
Copy link
Member

ignore the macOS failure... I need to fix that.

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM! These look awesome and really fit in with VS Code's design

@jpogran
Copy link
Author

jpogran commented Oct 16, 2019

It's great to see the reaction to this, and the two approvals. Is there anything waiting on me to do to get this merged?

@TylerLeonhardt
Copy link
Member

Nope! Thank you for your contribution! People are so pumped for this.

@TylerLeonhardt TylerLeonhardt merged commit 5f1257c into PowerShell:master Oct 16, 2019
TylerLeonhardt pushed a commit that referenced this pull request Oct 16, 2019
* Provide Run Selection button in Editor Title Menu

This commit adds a editor title menu button for the
`powershell.RunSelection` command in the primary navigation group, and
a custom `play` icon based on ones from the
https://github.com/microsoft/vscode-icons repo. This shows the button
in the visible part of the menu when a PowerShell file is open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide F8 Action button on the menu in VS Code, just like the F8 in the PowerShell ISE Menu bar.
4 participants