Skip to content

fix: a DAP run configuration without a file starts its session without an empty file name in the console - #2165

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/dap-title-without-file
Nov 23, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/dap-title-without-file

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

Fixes #2154

What

A DAP run configuration whose file field is empty started its session with the console line

Attaching '' with 'DAP server' at 127.0.0.1:39079

with empty quotes where the file goes. The same happened with Launching ''.

Change

DAPDebugProcess.getStartingServerTaskTitle built the line, which is also the title of the task that starts the DAP server. It left out the file, and the with before the server's name, only when the file was null. The file of a run configuration whose file field is empty is an empty string. A blank file is now treated as no file.

To test the method, it's package-private now, as getConsoleText is.

Behaviour change

Before After
Attaching '' with 'DAP server' at 127.0.0.1:39079 Attaching 'DAP server' at 127.0.0.1:39079

A configuration with a file, or with a null file, gets the same line as before.

Test

  • New DAPDebugProcessStartingTitleTest: with a file (Unix and Windows paths), without one, and with an empty or a blank one.
  • Without the change, only the empty-or-blank test fails. The other two pin the earlier behaviour.
  • The DAPDebugProcess* test classes: 17 tests, 0 failures, on IC 2024.2, IC 2025.3 and IU 2026.3.
  • The dap package on 2024.2: 384 tests, 0 failures.

…t an empty file name in the console

The title of the task that starts the DAP server, which the console prints
too, left out the file only when it was null. The file of a run
configuration whose file field is empty is an empty string, so the line
read "Attaching '' with 'DAP server' at ...". A blank file is now treated
as no file: "Attaching 'DAP server' at ...".

Fixes redhat-developer#2154
@lagergren lagergren added this to the 0.30.2 milestone Nov 23, 2026
@lagergren lagergren added bug Something isn't working dap Debugging Adapter Protocol labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Starting-server task titles no longer display an empty filename or an unnecessary “with” separator when no usable file path is provided.
    • Titles continue to include a filename when one is available, across launch and attach modes.

The starting-server task title now treats null and blank file values as absent. Tests cover titles for attach and launch modes, including file paths and server or address details.

Changes: Starting-server title formatting

Layer / File(s) Summary
Build and verify starting-server titles
src/main/java/com/redhat/devtools/lsp4ij/dap/DAPDebugProcess.java, src/test/java/com/redhat/devtools/lsp4ij/dap/DAPDebugProcessStartingTitleTest.java
The title builder adds file details and the “with” prefix only when the file is non-null and non-blank. Tests cover null, empty, blank, and non-blank file values for attach and launch modes.

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: angelozerr

Merge Risk: Minimal · up to d8520

This change removes the empty quotes and the stray "with" from the Attaching and Launching console lines when the file field is blank. Configurations with a file path keep their previous output. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title accurately describes the main change: a DAP run configuration without a file no longer shows an empty file name in the starting console line. It follows the conventional-commit style and is …
Description check Passed The description is directly related to the changeset. It explains the bug (empty quotes in the Attaching/Launching console line), the fix in DAPDebugProcess.getStartingServerTaskTitle (a blank file is…
Linked Issues check Passed [#2154] requires that a blank file in a DAP run configuration be treated like a null file, so the console line becomes Attaching 'DAP server' at 127.0.0.1:39079 without the empty quotes or the prece…
Out of Scope Changes check Passed The changes are limited to DAPDebugProcess.getStartingServerTaskTitle (blank-file handling, per the supplied summary), its visibility change from private to package-private, and the new `DAPDebugPro…
Full details: Title check

Explanation

The title accurately describes the main change: a DAP run configuration without a file no longer shows an empty file name in the starting console line. It follows the conventional-commit style and is specific. It is 104 characters, slightly long, but this does not affect the verdict.

Full details: Description check

Explanation

The description is directly related to the changeset. It explains the bug (empty quotes in the Attaching/Launching console line), the fix in DAPDebugProcess.getStartingServerTaskTitle (a blank file is treated as no file), the package-private visibility change for testing, the before/after behaviour, and the tests added and run.

Full details: Linked Issues check

Explanation

[#2154] requires that a blank file in a DAP run configuration be treated like a null file, so the console line becomes Attaching 'DAP server' at 127.0.0.1:39079 without the empty quotes or the preceding with. The supplied raw summary states that getStartingServerTaskTitle now treats a file as present only when it is non-null and non-blank. The new test DAPDebugProcessStartingTitleTest at the reviewed head asserts this behavior: an empty string "" and a blank string " " yield Attaching 'DAP server' at 127.0.0.1:39079 and Launching 'VSCode JS Debug'. A null file yields the same output. A file, with Unix or Windows paths, still yields Attaching 'inventory.c' with 'DAP server' .... The constructor of DAPDebugProcess at the reviewed head still passes dapState.getFile() to this method, so the title and the console line share the fixed logic. Limitation: the diff read failed because changed blobs were missing, and the method body was not read directly. The verdict relies on the supplied summary and the test assertions at the reviewed head. No coding requirement is unmet on this evidence.

Full details: Out of Scope Changes check

Explanation

The changes are limited to DAPDebugProcess.getStartingServerTaskTitle (blank-file handling, per the supplied summary), its visibility change from private to package-private, and the new DAPDebugProcessStartingTitleTest. The visibility change supports the new test, which the PR description states is its purpose, and it matches the existing package-private getConsoleText pattern. The test covers the same-line title output for file, no file, empty and blank file cases, which fits the linked issue. The summary reports no change to public declarations. No unrelated change was identified. Limitation: the diff read failed, so the full hunk set was not checked directly. The summary is the basis for this verdict.

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: add59db0-b801-4ca1-a283-f45f8d39d3c8
Commits

Reviewing files that changed from the base of the PR and between cb29f9f and d85205d.

Files selected for processing: 2

  • src/main/java/com/redhat/devtools/lsp4ij/dap/DAPDebugProcess.java
  • src/test/java/com/redhat/devtools/lsp4ij/dap/DAPDebugProcessStartingTitleTest.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 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.82%. Comparing base (cb29f9f) to head (d85205d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2165   +/-   ##
=======================================
  Coverage   53.82%   53.82%           
=======================================
  Files         828      828           
  Lines       35034    35035    +1     
  Branches     5493     5494    +1     
=======================================
+ Hits        18856    18858    +2     
- Misses      13378    13384    +6     
+ Partials     2800     2793    -7     

☔ 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

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

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

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 23, 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 a55e996 into redhat-developer:main Nov 23, 2026
9 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: a configuration without a file starts its session with "Attaching '' with …" in the console

1 participant