forked from microsoft/vscode-js-debug
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: don't attach debugger to terminal until a process starts (micro…
…soft#221) * feat: don't attach debugger to terminal until a process starts As referenced in microsoft#199, the debugger terminal experience today is awkward in that a session is 'running' as long as the terminal is open, even when no Node.js processes are currently active. This PR addresses that. We reuse the `TerminalNodeLauncher` to set up the terminal, but do so outside of the debug adapter. Instead, when we see a process launches and enters debug mode, we register it inside of a 'delegate' collection, and then send the delegate ID into `vscode.debug.startDebugging`. This pulls up the debug session as if it was just launched insider the adapter, and from then on it's identical to any other debug session. This PR also adds an configuration option that configures the default launch config used for the debugger terminal, and there's churn from typing the `targetOrigin` away from `any` throughout the process, now that I've fully internalized what it is and what it's used for :) This implementation has some indirection, but within the adapter's architecture I believe this is the best general approach. Due to the way in which we launch processes and the way the VS Code terminal behaves (both of which are optimal), we can't ever know that we have a debuggable target exists until it knocks on our door with a CDP connection. At that point, we need to delegate it into a debug session in some form or another. That's what I've tried to do here with a minimal amount of changes or knowledge-leaks into the rest of the code. Fixes microsoft#199 * fix: use terminal attach as delegate mode instead of different type
- Loading branch information
1 parent
53a36eb
commit 679105b
Showing
33 changed files
with
734 additions
and
193 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.