Skip to content

Respect the CancelationToken in provideDebugConfigurations and resolveDebugConfigurations to cancel debugging #77293

@ivanhernandez13

Description

@ivanhernandez13
  • VSCode Version: 1.36 & 1.37-insiders
  • OS Version: macOS 10.14.5

Steps to Reproduce:

  1. clone vscode-mock-debug.
  2. Open vscode-mock-debug in vscode.
  3. Add the following to resolveDebugConfiguration() in extension.ts.
    for (let i = 0; i < 10000; i++) { console.log(i) }
  4. Start debugging the extension.
  5. Open a workspace with a MARKDOWN file.
  6. Start a debug session and immediately click on stop.

The debug toolbar will hide but won't do anything. The debug adapter will still launch and the debug session will begin and thus the toolbar will reappear.

Video: https://1drv.ms/v/s!AiguEN65RhivhFQM-7S7ayzDQ3l6

Note in the video that clicking on stop before the debug adapter has launched won't trigger vscode.debug.onDidTerminateDebugSession() to be called. Is there a way to detect that the user has tried to stop the debug session after they have clicked to start the debug session but before the debug adapter has launched e.g. in the middle of resolveDebugConfiguration()? resolveDebugConfiguration() takes a CancellationToken but adding an event handler to onCancellationRequested() doesn't seem to be called and checking isCancellationRequested at the end of resolveDebugConfiguration() is still false.

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Labels

debtCode quality issuesdebugDebug viewlet, configurations, breakpoints, adapter issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions