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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@
"command": "PowerShell.OpenExamplesFolder",
"title": "Open Examples Folder",
"category": "PowerShell"
},
{
"command": "PowerShell.InvokeRegisteredEditorCommand",
"title": "Invoke Registered Editor Command",
"category": "PowerShell"
}
],
"menus": {
Expand All @@ -246,6 +251,10 @@
{
"command": "PowerShell.RefreshCommandsExplorer",
"when": "config.powershell.sideBar.CommandExplorerVisibility"
},
{
"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.

}
],
"editor/context": [
Expand Down