TaskDebugAdapterAction

A TaskDebugAdapterAction object represents an action that can be used as part of a Task which invokes a debug adapter conforming to the Debug Adapter Protocol.

The TaskDebugAdapterAction class is not subclassable.

Added in Nova 9.

Class Methods

constructor(adapterType)

Creates a TaskDebugAdapterAction object that interfaces with a debug adapter.

The adapterType is a string denoting the adapter’s identifier. This identifier should be unique across the workspace, and is generally recommended to be the identifier of the debugger or adapter itself, such as debugpy, chrome-devtools, etc. This parameter is used to link the instance with its adapter description in the extension manifest.

class PythonTaskAssistant {
    resolveTaskAction(context) {
        let config = context.config;
        
        let action = new TaskDebugAdapterAction('debugpy');
        
        action.command = "/usr/bin/python3";
        action.args = ["-m", "debugpy"];
        
        action.debugArgs = {
            program: config.get("python.debug.script", "string")
        };
        
        task.setActionAction(Task.Run, action);
    }
}

Properties

adapterStart

Determines how the adapter is started by Nova. Valid values are:

args

The arguments passed to the debug adapter process (as an Array).

Note: these are the arguments passed when launching the adapter, not the debuggee. Passing arguments to the debuggee requires support from the adapter via a key in the debugArgs property. This property is ignored if the adapter is not launched by Nova.

This property is settable.

command

The command used to launch the debug adapter. This property is ignored if the adapter is not launched by Nova.

This property is settable.

cwd

The current working directory for the debug adapter. If not specified, the project directory will be used. This property is ignored if the adapter is not launched by Nova.

This property is settable.

debugArgs

Arguments passed to the debug adapter for use in setting up its options and starting the debuggee. This corresponds to the arguments argument of the Launch or Attach request of the Debug Adapter Protocol.

This object is freeform and the contents of it is not defined by Nova’s extension API (beyond it being an object). Check the documentation for the specific adapter for more information.

debugRequest

The method by which the adapter should attempt to start debugging the debuggee. Valid values are:

Not all adapters support both types of debug request. Check the documentation for the specific adapter for more information.

env

The environment variables (as an Object) set for the debug adapter. This property is ignored if the adapter is not launched by Nova.

This property is settable.

socketHost

The host on which to attempt to connect to a Socket to communicate with the adapter. This property is only referenced when the transport is set to socket. By default, if no value is specified, this defaults to localhost.

socketPath

The path at which to connect to a Unix Domain Socket to communicate with the adapter. This property is only referenced when the transport is set to domainSocket. This property is required if using Unix Domain Socket communication.

socketPort

The port on which to attempt to connect to a Socket to communicate with the adapter. This property is only referenced when the transport is set to socket. This property is required if using Socket communication.

transport

The transport mechanism to use to communicate with the adapter. Valid values are: