-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Closed
Labels
debugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issuestestplan-item
Milestone
Description
Test for #45220, #56646, #57706, #54465:
- anyOS: @isidorn
Complexity: 4
Authors: @weinand
- Please read the 4 feature requests from above to understand the scope of this feature.
- A high level-description of the feature is here: https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/v1_28.md#debug-api
- Add a method
provideDebugAdapterto theMockConfigurationProviderof mock-debug extension (or any other debug extension) and verify (and try to break):
Verify that:
- the API works as described.
- specifically verify that the 2 constraints are obeyed:
- an extension is only allowed to register a DebugConfigurationProvider with a provideDebugAdapter method if the extension defines the debug type. Otherwise an error is thrown.
- registering more than one DebugConfigurationProvider with a provideDebugAdapter method for a type results in an error.
- verify that the following cases work:
the default behaviour:
provideDebugAdapter3(session, folder, executable, config): ProviderResult<DebugAdapterDescriptor> {
return executable;
}
You can add env vars and cwd:
provideDebugAdapter3(session, folder, executable, config): ProviderResult<DebugAdapterDescriptor> {
return new DebugAdapterExecutable(executable.command, executable.args, { foo: "bar" });
}
You can emulate VS Code's debugServer feature with this:
provideDebugAdapter3(session, folder, executable, config): ProviderResult<DebugAdapterDescriptor> {
if (typeof config.debugServer === 'number') {
return newDebugAdapterServer(config.debugServer);
}
return executable;
}
You can run the DA as a server automatically:
provideDebugAdapter3(session, folder, executable, config): ProviderResult<DebugAdapterDescriptor> {
// start server on launch of first debug session
if (!this._server) {
// start listening on a random port
this._server = Net.createServer(socket => {
const session = new MockDebugSession();
session.setRunAsServer(true);
session.start(<NodeJS.ReadableStream>socket, socket);
}).listen(0);
}
// make VS Code connect to debug server instead of launching debug adapter
return newDebugAdapterServer(this._server.address().port);
}
The last option to return a DebugAdapterImplementation is not yet available because it requires a matching node-module that I did not made available yet.
Metadata
Metadata
Assignees
Labels
debugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issuestestplan-item