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

Surface Invoke Registered Editor Command #2225

Conversation

jpogran
Copy link

@jpogran jpogran commented Oct 3, 2019

PR Summary

This commit allows the PowerShell.InvokeRegisteredEditorCommand command to be accessible to the user in the Command Palette.

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

Fixes #2145

This commit allows the `PowerShell.InvokeRegisteredEditorCommand`
command to be accessible to the user in the Command Palette.
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! Gosh I love json-only changes that expose new features

@jpogran
Copy link
Author

jpogran commented Oct 16, 2019

I see two approvals for this, is there anything waiting on me to do to get this merged?

@TylerLeonhardt
Copy link
Member

Thank you for your contribution! So many people have asked for this! 🎉

@TylerLeonhardt TylerLeonhardt merged commit 4b0b965 into PowerShell:master Oct 16, 2019
TylerLeonhardt pushed a commit that referenced this pull request Oct 16, 2019
This commit allows the `PowerShell.InvokeRegisteredEditorCommand`
command to be accessible to the user in the Command Palette.
},
{
"command": "PowerShell.InvokeRegisteredEditorCommand",
"when": "false"
Copy link
Member

Choose a reason for hiding this comment

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

@TylerLeonhardt As far as I can tell this means that the command will never be shown in the command palette...so this PR didn't do what it intended. 🧐

Copy link
Member

Choose a reason for hiding this comment

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

FYI @rjmholt

Copy link
Collaborator

Choose a reason for hiding this comment

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

@TylerLeonhardt As far as I can tell this means that the command will never be shown in the command palette...so this PR didn't do what it intended. 🧐

I believe it's just the description that is off. This PR enabled it's usage in keybinds, e.g. this failed before it:

{
    "key": "alt+shift+s",
    "command": "PowerShell.InvokeRegisteredEditorCommand",
    "args": { "commandName": "ConvertTo-SplatExpression" },
    "when": "editorLangId == 'powershell'"
},

Since it has parameters, and "Show Additional Commands from PowerShell Modules" fills the command palette role, I believe this was intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add InvokeRegisteredEditorCommand to package.json
5 participants