Skip to main content

Class: CommandRunner

core/commandRunner/CommandRunner.CommandRunner

Constructors

constructor

new CommandRunner(graph, thatMark, sourceMark)

Parameters

NameType
graphGraph
thatMarkThatMark
sourceMarkThatMark

Defined in

core/commandRunner/CommandRunner.ts:29

Properties

disposables

Private disposables: Disposable[] = []

Defined in

core/commandRunner/CommandRunner.ts:27

Methods

dispose

dispose(): void

Returns

void

Defined in

core/commandRunner/CommandRunner.ts:232


runCommand

runCommand(command): Promise<any>

Entry point for Cursorless commands. We proceed as follows:

  1. Canonicalize the action name and target representation using canonicalizeAndValidateCommand, primarily for the purpose of backwards compatibility
  2. Perform inference on targets to fill in details left out using things like previous targets. For example we would automatically infer that "take funk air and bat" is equivalent to "take funk air and funk bat". See inferFullTargets for details of how this is done.
  3. Construct a ProcessedTargetsContext object to capture the environment needed by processTargets.
  4. Call processTargets to map each abstract Target object to a concrete list of Target objects.
  5. Run the requested action on the given selections. The mapping from action id (eg remove) to implementation is defined in Actions. To understand how actions work, see some examples, such as "take" SetSelection and "chuck" Delete. See
  6. Update source and that marks, if they have been returned from the action, and returns the desired return value indicated by the action, if it has one.

Parameters

NameType
commandCommand

Returns

Promise<any>

Defined in

core/commandRunner/CommandRunner.ts:70


runCommandBackwardCompatible

Private runCommandBackwardCompatible(spokenFormOrCommand, ...rest): Promise<any>

Parameters

NameType
spokenFormOrCommandstring | Command
...restunknown[]

Returns

Promise<any>

Defined in

core/commandRunner/CommandRunner.ts:203


showUpdateExtensionErrorMessage

showUpdateExtensionErrorMessage(err): Promise<void>

Parameters

NameType
errOutdatedExtensionError

Returns

Promise<void>

Defined in

core/commandRunner/CommandRunner.ts:188