Interface CommandService

The command service should be used to execute commands.

interface CommandService {
    onDidExecuteCommand: Event<CommandEvent>;
    onWillExecuteCommand: Event<WillExecuteCommandEvent>;
    executeCommand<T>(command, ...args): Promise<undefined | T>;
}

Implemented by

Properties

onDidExecuteCommand: Event<CommandEvent>

An event is emitted when a command was executed.

onWillExecuteCommand: Event<WillExecuteCommandEvent>

An event is emitted when a command is about to be executed.

It can be used to install or activate a command handler.

Methods

  • Execute the active handler for the given command and arguments.

    Reject if a command cannot be executed.

    Type Parameters

    • T

    Parameters

    • command: string
    • Rest ...args: any[]

    Returns Promise<undefined | T>