Repository navigation
Bound Node debug adapter startup - #2319
Merged
akurtakov merged 1 commit intoDec 3, 2026
Merged
Conversation
| throw new CoreException(Status.error("Debug adapter not found.", ex)); //$NON-NLS-1$ | ||
| } | ||
| int port = DebugAdapter.findFreePort(); | ||
| DebugAdapter adapter = DebugAdapter.start(launch, new String[] { runtimeExecutable.getAbsolutePath(), |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Immediate handshake failures can omit captured adapter diagnostics and let unchecked exceptions escape instead of producing a diagnostic CoreException.
1 open issue
What changed in this PR
Centralizes Node debug adapter lifecycle handling for launch and attach, adding bounded startup handling, failure diagnostics, and process cleanup.
Changes:
- Introduces a shared
DebugAdapterfor startup monitoring, handshake timeouts, cancellation, and cleanup. - Refactors both delegates to use it, with attach now inheriting Eclipse’s environment and using IPv4 loopback.
- Adds tests for cancellation, adapter exits, and handshake timeouts.
| File | Description |
|---|---|
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/node/VSCodeJSDebugDelegate.java | Replaces duplicated launch lifecycle code with the shared adapter. |
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/node/NodeAttachDebugDelegate.java | Adopts shared handling, inherited environment, and IPv4 loopback. |
| org.eclipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/node/DebugAdapter.java | Implements adapter monitoring, diagnostics, timeouts, and cleanup. |
| org.eclipse.wildwebdeveloper.tests/src/org/eclipse/wildwebdeveloper/tests/TestDebug.java | Adds cancellation and adapter failure tests. |
Review effort: Balanced
| if (ex instanceof OperationCanceledException) { | ||
| throw canceled(); | ||
| } | ||
| throw ex; |
Contributor
|
I'm concerned about large last minute changes that will end up in the release without having even been tested by any user. Is now really a good time for such changes I wonder? Also this PR has a copilot review while a new PR is being queued up: Maybe we could finish one after another. And we do need to find closure very, very soon. |
akurtakov
force-pushed
the
fix/debug-adapter-startup
branch
2 times, most recently
from
December 3, 2026 06:11
004781d to
7ba4d9d
Compare
Fail the launch with an error which includes the adapter output when the Node debug adapter exits, does not complete the DAP handshake in time or the launch is canceled, and stop the adapter process. Attach now behaves like launch: it uses 127.0.0.1 instead of localhost and ::1, waits up to 10 seconds for the adapter, bounds the handshake and passes Eclipse's environment to the adapter. Assisted-by: multiple AI agents and layers of automated tooling 🤖
akurtakov
force-pushed
the
fix/debug-adapter-startup
branch
from
December 3, 2026 06:13
7ba4d9d to
6a9aa47
Compare
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.

A Node debug adapter which crashed, never answered or was canceled during launch could leave the launch hanging, running on silently or reporting nothing useful.
DebugAdapter(extracted in #2336) now handles these cases for both launch and attach: they end the launch with an error that includes the adapter's stdout and stderr, and the adapter process is stopped.Changes to the attach delegate, which now behaves like launch:
127.0.0.1and connects to it, instead of the adapter's defaultlocalhostand a connection to::1;New tests in
TestDebugcover cancellation, an adapter which exits during startup or the handshake, and a handshake timeout.