vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

Support canceling a debug request from the client

Open akaroml opened this issue 6 years ago • 1 comments

https://code.visualstudio.com/updates/v1_39#_cancellation-support

In the 1.39, vscode added cancellation support in DAP. It tells the server that the client is no longer interested in the response of a previous request. This is potentially useful for time-consuming requests like evaluation, stacktrace, scopes, and variables.

Let's investigate whether this is possible with JVM.

akaroml avatar Oct 23 '19 07:10 akaroml

Hi @akaroml, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

It looks like the Java debug adapter doesn’t yet honor DAP’s “cancel” request (added in VS Code 1.39) on long-running operations. To add support you would need to:

  • Read the DAP spec for cancel (Requests/cancel): • https://microsoft.github.io/debug-adapter-protocol/specification#Requests_cancel
  • In a Node-based adapter you’d hook the cancel event on the DebugSession (see vscode-debugadapter-node’s cancellation support).
  • In the Java-based adapter (vscode-java-debug) you’d implement a handler in your ProtocolEndpoint (or equivalent) that listens for the cancel request and interrupts any ongoing evaluation, stacktrace, variables, etc.

No existing issue in vscode-java-debug tracks this feature—please open a new enhancement request if you’d like it prioritized.

Other references with low confidence:

Related GitHub threads
  • Support logpoint with the debug protocol changes (mentions new DAP requests like terminateThreads and setExpression but not cancellation) • URL: https://github.com/microsoft/vscode-java-debug/issues/272

  • Add Debug support (Eclipse JDT-LS discussion of using vscode-debugadapter-node, may touch on protocol extensions) • URL: https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/157#issuecomment-297402014

The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

github-actions[bot] avatar Nov 11 '25 12:11 github-actions[bot]