Skip to content

fix: a running DAP debug session can be paused - #2366

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/dap-pause-action
Nov 30, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/dap-pause-action

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

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). DAPDebugProcess implements startPausing(), which sends the DAP pause request, 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 as false on every version that LSP4IJ supports. On IntelliJ 2024.2, XDebuggerPauseActionHandler.isEnabled checks isPauseActionSupported() and !isPaused(), and only setPauseActionSupported sets the flag (read with javap); the report shows the same on 2025.3.

The change

DAPDebugProcess calls session.setPauseActionSupported(isDebug) when it's created, as other debuggers do. DAP has no capability for pause: every debug adapter must answer it. A run without debugging (noDebug), which also has a DAPDebugProcess, doesn't offer Pause. One fix: commit, so one line in the release notes. setPauseActionSupported isn't deprecated on IU 2026.3 (compiled with -Xlint:deprecation).

Tests

DAPPauseSessionTest starts a DAP configuration attached to a fake debug adapter whose program runs until it's paused:

Test With the change Without it
testARunningDebugSessionCanBePaused: Pause is supported, and XDebugSession.pause(), which the Pause action calls, sends pause, and the session stops passes fails: IntelliJ enables Pause only when the debug process supports it
testARunWithoutDebuggingCannotBePaused passes passes

Headless on macOS, with the counts from the JUnit XMLs:

IntelliJ DAPPauseSessionTest All DAP tests (com.redhat.devtools.lsp4ij.dap.*)
IC 2024.2 2 tests, 0 failures 655 tests in 111 classes, 0 failures
IC 2025.3 2 tests, 0 failures
IU 2026.3 2 tests, 0 failures

Not checked live: Pause with a real debug adapter in the IDE's UI.

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
@lagergren lagergren added this to the 0.30.2 milestone Nov 30, 2026
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • The Pause action is now available for debug sessions and hidden for sessions running without debugging. Session controls more accurately reflect whether pausing is supported, and debug sessions can still be paused and enter a suspended state.

The DAP debug process now enables IntelliJ’s Pause action for debug sessions. Tests cover Pause support in debug and non-debug runs and verify that a pause request suspends a running session.

Changes: DAP Pause Support

Layer / File(s) Summary
Pause action support and validation
src/main/java/com/redhat/devtools/lsp4ij/dap/DAPDebugProcess.java, src/test/java/com/redhat/devtools/lsp4ij/dap/client/DAPPauseSessionTest.java
The constructor enables Pause action support when isDebug is true. Tests check that non-debug runs do not support Pause and that a debug session becomes suspended after the DAP server receives a pause request.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: angelozerr

Merge Risk: Minimal · up to 4106d

Debug sessions using DAP now enable IntelliJ's Pause action, and runs without debugging do not. The change is small and covered by tests, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix: a running DAP debug session can be paused" names the main change. The PR makes IntelliJ's Pause action available in DAP debug sessions by calling session.setPauseActionSupported(isDebu…
Description check Passed The description explains the cause (IntelliJ enables Pause only when the debug process calls setPauseActionSupported(true)), the change in DAPDebugProcess, the noDebug exclusion, the new DAPPauseSessi…
Linked Issues check Passed [#2365] The issue requires that a running DAP debug session expose IntelliJ's Pause action. It names the missing setPauseActionSupported(true) call as the cause. At the reviewed head, the `DAPDebugP…
Out of Scope Changes check Passed The functional change is a single call in DAPDebugProcess (+3 lines, per the summary), and it directly implements #2365. The added DAPPauseSessionTest supports that change. The PR description and …
Full details: Title check

Explanation

The title "fix: a running DAP debug session can be paused" names the main change. The PR makes IntelliJ's Pause action available in DAP debug sessions by calling session.setPauseActionSupported(isDebug) in DAPDebugProcess. The title is concise, specific, and follows the conventional-commit style.

Full details: Description check

Explanation

The description explains the cause (IntelliJ enables Pause only when the debug process calls setPauseActionSupported(true)), the change in DAPDebugProcess, the noDebug exclusion, the new DAPPauseSessionTest tests, and the test results across IntelliJ versions. It relates directly to the changeset.

Full details: Linked Issues check

Explanation

[#2365] The issue requires that a running DAP debug session expose IntelliJ's Pause action. It names the missing setPauseActionSupported(true) call as the cause. At the reviewed head, the DAPDebugProcess constructor calls session.setPauseActionSupported(isDebug) before other setup. Debug sessions therefore enable Pause, and noDebug runs do not. The issue lists the call site as an example (session start or after initialize), so placing it in the constructor meets the requirement. The PR summary reports DAPPauseSessionTest covering the debug case and the noDebug case. I did not read the test file, so the test evidence rests on the summary. Live UI behavior with a real adapter was not verified, and the issue does not require that check as a coding item.

Full details: Out of Scope Changes check

Explanation

The functional change is a single call in DAPDebugProcess (+3 lines, per the summary), and it directly implements #2365. The added DAPPauseSessionTest supports that change. The PR description and the raw summary report no other production changes. I did not inspect the complete whole-PR diff, because the diff read for DAPDebugProcess returned a truncated result and the changed blobs were not available as a diff. The file content at head confirms the constructor call. No unrelated change was found in the evidence available.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a24b914e-f031-46e0-80db-b706db05ad87
Commits

Reviewing files that changed from the base of the PR and between 0612fe5 and 4106ddc.

Files selected for processing: 2

  • src/main/java/com/redhat/devtools/lsp4ij/dap/DAPDebugProcess.java
  • src/test/java/com/redhat/devtools/lsp4ij/dap/client/DAPPauseSessionTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.86%. Comparing base (0612fe5) to head (4106ddc).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lagergren

Copy link
Copy Markdown
Collaborator Author

Thank you, @kevinhagel, for #2365! Your report pinned down the cause, the missing setPauseActionSupported call, and your workaround is the fix here, almost line for line. It saved a lot of digging, and every DAP user gets a working Pause button in 0.30.2.

@lagergren lagergren added bug Something isn't working dap Debugging Adapter Protocol labels Nov 30, 2026
@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren
lagergren merged commit 3f4fd2a into redhat-developer:main Nov 30, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dap Debugging Adapter Protocol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DAP debugging: Pause action is never enabled (setPauseActionSupported is not called)

1 participant