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
Use the CommandQuickAccess provider #176682
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving from platform to workbench means this is no longer available in Monaco standalone.
This is a command I introduced to help me with some debugging related efforts. It was never intended to work in standalone monaco. Additionally, this command has not shipped in any stable version and is prefixed with |
FYI @bpasero would love your thoughts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented inline.
@@ -127,6 +124,13 @@ export class CommandsQuickAccessProvider extends AbstractEditorCommandsQuickAcce | |||
})); | |||
} | |||
|
|||
public getCommandInfo(): Array<ICommandQuickPick> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public getCommandInfo(): Array<ICommandQuickPick> { | |
getCommandInfo(): Array<ICommandQuickPick> { |
@@ -227,4 +231,15 @@ export class ClearCommandHistoryAction extends Action2 { | |||
} | |||
} | |||
|
|||
//#region --- Register a command to get all actions from the command palette | |||
CommandsRegistry.registerCommand('_getAllCommands', async function (accessor: ServicesAccessor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this? It is somewhat ugly that we instantiate a UI component here only to get to the commands. Maybe the functionality for getting the commands should better be extracted to its own function or class?
Appears the
MenuRegistry
is missing editor commands for the command palette so commands likeFormat Document
are not available.Maybe we should think about switching to the
CommandRegistry
at some point, but for now the command palette has nice names for common commads which makes finding what you want for development easy.