Support a "debug target ready" hook for launch configs #69311
Labels
debug
Debug viewlet, configurations, breakpoints, adapter issues
feature-request
Request for new features or functionality
on-testplan
Milestone
The discussion of microsoft/debug-adapter-protocol#23 came to the conclusion not to extend the Debug Adapter Protocol, but to implement a new VS Code feature instead.
This feature makes it possible to add the following structured property
serverReadyAction
to any launch config:The feature looks for patterns of the form "listening on port 3000" or "Now listening on: https://localhost:5001" in the debug console output. If the pattern is found it extracts from it a port number or a URI (if only a port number is given, it is converted to a URI of the form "http://localhost:").
Then it opens the URI outside of VS Code ("externally") with the standard application configured for the URI's scheme.
Alternatively the
action
can be set todebugWithChrome
. In this case VS Code starts a Chrome debug session for the URI (this requires that the "Debugger for Chrome" is installed).Here are all supported properties and their default values:
In order for VS Code to locate and extract the port or URI in the pattern, that part of the pattern must be enclosed in parenthesis (aka "capture group"). If the pattern requires additional parenthesis, they must be marked as "non capturing" through the syntax:
(?:pattern)
.Please note:
In the preview release of the feature...
debugWithChrome
is configured and the "Debugger for Chrome" is not installed (but a correct error message is shown).The text was updated successfully, but these errors were encountered: