Repository navigation
Extract the Node debug adapter process handling into DebugAdapter - #2336
Merged
akurtakov merged 1 commit intoDec 3, 2026
Merged
Conversation
The launch and attach delegates both started the vscode-js-debug server with their own copies of the code to find a free port, wait for its listening announcement and terminate it with the launch. Move that into a package private DebugAdapter class, keeping the delegates' behaviour. Assisted-by: Anthropic Claude Code (claude-opus-5-5)
| } | ||
| int port = DebugAdapter.findFreePort(); | ||
| DebugAdapter adapter = DebugAdapter.start(launch, | ||
| new String[] { runtimeExecutable.getAbsolutePath(), file.getAbsolutePath(), Integer.toString(port) }, |
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.
The launch (
VSCodeJSDebugDelegate) and attach (NodeAttachDebugDelegate) delegates both start the vscode-js-debug server with their own copies of the code to:listening <host>:<port>announcement;This moves that code into a package private
DebugAdapterclass without functional changes. It is split out of #2319 so that the functional changes there (failing the launch when the adapter exits, times out or is canceled) can be reviewed on their own.The delegates keep their differences:
127.0.0.1, logs the adapter's stderr, waits up to 10 s for the announcement and keeps its handshake watchdog;::1. The old loop conditionDuration.compareTo(...) < 3only ended during the 4th second.The only differences in attach are in its wait for the announcement:
<host>:<port>part instead of any chunk containinglisteningin any case;TestDebug passes locally. No test covers attach.