Theia API Documentation v1.67.0
    Preparing search index...

    Function registerTextEditorCommand

    • Registers a text editor command that can be invoked via a keyboard shortcut, a menu item, an action, or directly.

      Text editor commands are different from ordinary commands as they only execute when there is an active editor when the command is called. Also, the command handler of an editor command has access to the active editor and to an edit-builder.

      Parameters

      • command: string

        A unique identifier for the command.

      • callback: (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void

        A command handler function with access to an editor and an edit.

      • OptionalthisArg: any

        The this context used when invoking the handler function.

      Returns Disposable

      Disposable which unregisters this command on disposal.