Properties
Protected Readonly codeEditorService
Protected Readonly commandRegistry
commandRegistry: CommandRegistry
Protected Readonly contextKeyService
contextKeyService: ContextKeyService
Protected editorManager
editorManager: EditorManager
Protected Readonly monacoCommandRegistry
Protected Readonly quickInputService
quickInputService: QuickInputService
Protected Readonly shell
shell: ApplicationShell
Protected Readonly textModelService
Register commands from Monaco to Theia registry.
Monaco has different kind of commands which should be handled differently by Theia.
Editor Actions
They should be registered with a label to be visible in the quick command palette.
Such actions should be enabled only if the current editor is available and it supports such action in the current context.
Editor Commands
Such actions should be enabled only if the current editor is available.
actions.findandeditor.action.startFindReplaceActionare registered as handlers forfindandreplace. If handlers are not enabled then the core should prevent the default browser behavior. Other Theia extensions can register alternative implementations using custom enablement.Global Commands
These commands are not necessary dependent on the current editor and enabled always. But they depend on services which are global in VS Code, but bound to the editor in Monaco, i.e.
ICodeEditorServiceorIContextKeyService. We should take care of providing Theia implementations for such services.Global Native or Editor Commands
Namely:
undo,redoandeditor.action.selectAll. They depend onICodeEditorService. They will try to delegate to the current editor and if it is not available delegate to the browser. They are registered as handlers for corresponding core commands always. Other Theia extensions can provide alternative implementations by introducing a dependency to@theia/monacoextension.Global Language Commands
Like
_executeCodeActionProvider, they depend onICodeEditorServiceandITextModelService.Global Context Commands
It is
setContext. It depends onIContextKeyService.Global Editor Commands
Like
openReferenceToSideandopenReference, they depend onIListService. We treat all commands which don't match any other category of global commands as global editor commands and execute them using the instantiation service of the current editor.