-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Closed
Labels
debugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-testplan
Milestone
Description
for details see microsoft/debug-adapter-protocol#79
Implementation pointers:
- Client capabilities are set here:
vscode/src/vs/workbench/contrib/debug/browser/debugSession.ts
Lines 286 to 300 in f51258b
await this.raw!.initialize({ clientID: 'vscode', clientName: this.productService.nameLong, adapterID: this.configuration.type, pathFormat: 'path', linesStartAt1: true, columnsStartAt1: true, supportsVariableType: true, // #8858 supportsVariablePaging: true, // #9537 supportsRunInTerminalRequest: true, // #10574 locale: platform.locale, supportsProgressReporting: true, // #92253 supportsInvalidatedEvent: true, // #106745 supportsMemoryReferences: true, //#129684 supportsArgsCanBeInterpretedByShell: true // #149910 - DAP's reverse requests are dispatched here:
vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.ts
Lines 611 to 669 in f51258b
private async dispatchRequest(request: DebugProtocol.Request, dbgr: IDebugger): Promise<void> { const response: DebugProtocol.Response = { type: 'response', seq: 0, command: request.command, request_seq: request.seq, success: true }; const safeSendResponse = (response: DebugProtocol.Response) => this.debugAdapter && this.debugAdapter.sendResponse(response); switch (request.command) { case 'launchVSCode': try { let result = await this.launchVsCode(<ILaunchVSCodeArguments>request.arguments); if (!result.success) { const showResult = await this.dialogSerivce.show(Severity.Warning, nls.localize('canNotStart', "The debugger needs to open a new tab or window for the debuggee but the browser prevented this. You must give permission to continue."), [nls.localize('continue', "Continue"), nls.localize('cancel', "Cancel")], { cancelId: 1 }); if (showResult.choice === 0) { result = await this.launchVsCode(<ILaunchVSCodeArguments>request.arguments); } else { response.success = false; safeSendResponse(response); await this.shutdown(); } } response.body = { rendererDebugPort: result.rendererDebugPort, }; safeSendResponse(response); } catch (err) { response.success = false; response.message = err.message; safeSendResponse(response); } break; case 'runInTerminal': try { const shellProcessId = await dbgr.runInTerminal(request.arguments as DebugProtocol.RunInTerminalRequestArguments, this.sessionId); const resp = response as DebugProtocol.RunInTerminalResponse; resp.body = {}; if (typeof shellProcessId === 'number') { resp.body.shellProcessId = shellProcessId; } safeSendResponse(resp); } catch (err) { response.success = false; response.message = err.message; safeSendResponse(response); } break; default: response.success = false; response.message = `unknown request '${request.command}'`; safeSendResponse(response); break; } } - The implementation should use the same code path as VS Code's extension API
debug.startDebugging
. See
vscode/src/vs/workbench/api/browser/mainThreadDebugService.ts
Lines 222 to 242 in f51258b
public async $startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise<boolean> { const folderUri = folder ? uri.revive(folder) : undefined; const launch = this.debugService.getConfigurationManager().getLaunch(folderUri); const parentSession = this.getSession(options.parentSessionID); const saveBeforeStart = typeof options.suppressSaveBeforeStart === 'boolean' ? !options.suppressSaveBeforeStart : undefined; const debugOptions: IDebugSessionOptions = { noDebug: options.noDebug, parentSession, lifecycleManagedByParent: options.lifecycleManagedByParent, repl: options.repl, compact: options.compact, debugUI: options.debugUI, compoundRoot: parentSession?.compoundRoot, saveBeforeRestart: saveBeforeStart }; try { return this.debugService.startDebugging(launch, nameOrConfig, debugOptions, saveBeforeStart); } catch (err) { throw new ErrorNoTelemetry(err && err.message ? err.message : 'cannot start debugging'); } }
Metadata
Metadata
Assignees
Labels
debugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-testplan