Execute the active handler for the given command and arguments.
Reject if a command cannot be executed.
Register the given command and handler if present.
Throw if a command is already registered for the given command identifier.
Register the given handler for the given command identifier.
a given command id
a command handler
Register a text editor command which can execute only if active editor present and command has access to the active editor
a command description
a command handler with access to text editor
Namespace for dealing with commands. In short, a command is a function with a unique identifier. The function is sometimes also called command handler.
Commands can be added using the registerCommand and registerTextEditorCommand functions. Registration can be split in two step: first register command without handler, second register handler by command id.
Any contributed command are available to any plugin, command can be invoked by executeCommand function.
Simple example that register command:
theia.commands.registerCommand({id:'say.hello.command'}, ()=>{ console.log("Hello World!"); });
Simple example that invoke command:
theia.commands.executeCommand('core.about');