Skip to content

Allow to specify arguments in the adapterExecutableCommand based on the debug configuration #57706

Closed
@rherrmann

Description

@rherrmann

For a custom debug adapter, written in Java, that uses LSP4J for client/server communication, I would like to be able to specify (debug server) program arguments derived from the debug configuration.

The extension uses a adapterExecutableCommand to determine the executable path, which is registered and implemented like this:

function registerGetDebugAdapterCommand(context: ExtensionContext) {
  context.subscriptions.push(commands.registerCommand('<command-id>', () => {
    return {
      command: '/absolve/path/to/executable',
      args: ['debug-server', '--trace']
    };
  }));
}

The --trace option shows details about the messages being sent forth and back and help during development or to track down problems in production. This option, however, I would like to set only if a corresponding setting in the debug configuration has been specified.

If the DebugConfiguration could be accessed from within the adapterExecutableCommand implementation, the arguments could be specified accordingly.

LSP4J makes it difficult to pass this information at a later point in time - the message tracing option needs to be set up when starting the listener that takes control over the communication process.

By passing this option through a custom request, the first few request/response cycles would go untraced.

VS Code version is 1.26

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)apidebugDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionalityon-testplan

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions