Repository navigation
fix: a running DAP debug session can be paused - #2366
Merged
Merged
Conversation
IntelliJ enables its Pause action only for a debug process that says it can pause, with XDebugSession.setPauseActionSupported(true), and DAPDebugProcess never said so: Pause was never available in a DAP debug session, and a program in an endless loop could only be stopped. DAP has no capability for the pause request, which every debug adapter must answer, so a debug session now says it can pause. A run without debugging (noDebug) doesn't. Fixes redhat-developer#2365
This was referenced Nov 30, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2366 +/- ##
==========================================
+ Coverage 58.85% 58.86% +0.01%
==========================================
Files 849 849
Lines 36719 36720 +1
Branches 5767 7609 +1842
==========================================
+ Hits 21610 21615 +5
+ Misses 12104 12095 -9
- Partials 3005 3010 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
Thank you, @kevinhagel, for #2365! Your report pinned down the cause, the missing |
Collaborator
Author
|
@coderabbitai review |
Action performed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2365, for 0.30.2. Thanks to @kevinhagel, who found the cause and the workaround.
IntelliJ enables its Pause action only for a debug process that says it can pause, with
XDebugSession.setPauseActionSupported(true).DAPDebugProcessimplementsstartPausing(), which sends the DAPpauserequest, but never said so. So Pause was never available in a DAP debug session, and a program in an endless loop could only be stopped.Not a regression: no version of LSP4IJ called
setPauseActionSupported, and IntelliJ's flag starts asfalseon every version that LSP4IJ supports. On IntelliJ 2024.2,XDebuggerPauseActionHandler.isEnabledchecksisPauseActionSupported()and!isPaused(), and onlysetPauseActionSupportedsets the flag (read withjavap); the report shows the same on 2025.3.The change
DAPDebugProcesscallssession.setPauseActionSupported(isDebug)when it's created, as other debuggers do. DAP has no capability forpause: every debug adapter must answer it. A run without debugging (noDebug), which also has aDAPDebugProcess, doesn't offer Pause. Onefix:commit, so one line in the release notes.setPauseActionSupportedisn't deprecated on IU 2026.3 (compiled with-Xlint:deprecation).Tests
DAPPauseSessionTeststarts a DAP configuration attached to a fake debug adapter whose program runs until it's paused:testARunningDebugSessionCanBePaused: Pause is supported, andXDebugSession.pause(), which the Pause action calls, sendspause, and the session stopsIntelliJ enables Pause only when the debug process supports ittestARunWithoutDebuggingCannotBePausedHeadless on macOS, with the counts from the JUnit XMLs:
DAPPauseSessionTestcom.redhat.devtools.lsp4ij.dap.*)Not checked live: Pause with a real debug adapter in the IDE's UI.