Skip to content

fix(dap): keep the command line of a command and an environment in DebugAdapterDescriptor, deprecated - #1963

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/keep-deprecated-dap-start-command-line
Nov 11, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/keep-deprecated-dap-start-command-line

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

#1684 replaced DebugAdapterDescriptor.createStartServerCommandLine(command, userEnvironmentVariables, includeSystemEnvironmentVariables) with a version that takes the working directory first. DebugAdapterDescriptor is the class that the DAP developer guide has a plugin extend, so a descriptor built against 0.21.0 that calls the old method no longer compiles against 0.30.0, and fails with a NoSuchMethodError at runtime.

The method is back, @Deprecated as in LSPIJUtils, and creates the command line without a working directory, as in 0.21.0. The new version stays the one that LSP4IJ calls.

  • DebugAdapterDescriptorTest checks that the deprecated method replaces ${port}, passes the environment variables and sets no working directory.
  • A comparison of the public and protected signatures of the released 0.21.0 jar with main no longer lists anything in DebugAdapterDescriptor.
  • The DAP tests pass: 272, 0 failures.

#1900 keeps DAPDebugProcess.findBreakpointById(Integer) the same way.

…bugAdapterDescriptor, deprecated

redhat-developer#1684 replaced createStartServerCommandLine(command,
userEnvironmentVariables, includeSystemEnvironmentVariables) with a
version that takes the working directory first. A DebugAdapterDescriptor
built against 0.21.0 that calls it no longer compiles, and fails with a
NoSuchMethodError at runtime. It is back, deprecated, and creates the
command line without a working directory, as in 0.21.0.
@lagergren lagergren added this to the 0.30.0 milestone Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Refactor
    • Added a deprecated compatibility overload for creating debug server commands without specifying a working directory.
  • Tests
    • Added coverage for environment variables, port substitution, and the absence of a working directory.

Adds a deprecated protected createStartServerCommandLine overload without a working-directory parameter. The overload delegates to the existing method with a null working directory. A test checks the resulting command and environment.

Changes: Debug adapter command compatibility

Layer / File(s) Summary
Add and test the deprecated overload
src/main/java/com/redhat/devtools/lsp4ij/dap/descriptors/DebugAdapterDescriptor.java, src/test/java/com/redhat/devtools/lsp4ij/dap/descriptors/DebugAdapterDescriptorTest.java
The new overload delegates with a null working directory. The test checks that the supplied environment variable is retained and ${port} is replaced with the assigned server port.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: sohamsakhare76-ai

Merge Risk: Minimal · up to 36304

This restores a previously removed overload so descriptors built against 0.21.0 keep compiling and running. No actionable merge risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title identifies the DAP change to the deprecated command-line overload in DebugAdapterDescriptor. It is related to the main change, despite slightly awkward wording.
Description check Passed The description explains that the deprecated overload was restored to preserve source and binary compatibility, and it summarizes the test coverage.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

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: 01e14e0f-96bf-4d23-beaa-53e730126160
Commits

Reviewing files that changed from the base of the PR and between b80ec21 and 363040a.

Files selected for processing: 2

  • src/main/java/com/redhat/devtools/lsp4ij/dap/descriptors/DebugAdapterDescriptor.java
  • src/test/java/com/redhat/devtools/lsp4ij/dap/descriptors/DebugAdapterDescriptorTest.java

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

@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.20%. Comparing base (b80ec21) to head (363040a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1963      +/-   ##
==========================================
+ Coverage   48.16%   48.20%   +0.03%     
==========================================
  Files         809      809              
  Lines       32486    32487       +1     
  Branches     5013     6620    +1607     
==========================================
+ Hits        15647    15659      +12     
+ Misses      14341    14335       -6     
+ Partials     2498     2493       -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
lagergren merged commit 72f5afe into redhat-developer:main Nov 11, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant