TaskCommandAction

A TaskCommandAction object represents an action that can be used as part of a Task that invokes an extension command registered with the CommandsRegistry, much in the same way as if the user had chosen a menu item bound to it.

The TaskCommandAction class is not subclassable.

Added in Nova 3.

Class Methods

constructor(command, [options])

Creates a TaskCommandAction object that will invoke the extension command named command.

The optional options can contain the following values:

Value Description
args Arguments to pass to the command (array)
let action = new TaskCommandAction('myextension.runAction', {
    args: ["I'm Running!"]
});

task.setAction(Task.Run, action);

nova.commands.register('myextension.runAction', (workspace, arg1) => {
    console.log(arg1);
});

Properties

args

The arguments passed to the command (as an Array).

See documentation for the CommandsRegistry for more information about how commands are invoked and how their arguments are handled.

This property is readonly.

command

The name used to register the command.

This property is readonly.