-
Notifications
You must be signed in to change notification settings - Fork 60
Add support for LogPoints in Node #163
Description
This is a part of a series of requests to enable "custom breakpoints" support in VS Code. See microsoft/vscode#38568
We want to light up LogPoints for the local Node debugging scenario in VS Code, so developers can get comfortable with LogPoints while debugging locally, and because we believe LogPoints will enable more people to get comfortable by using a debugger, as it's an experience that's closer to using console.log's.
Functionality
-
I imagine LogPoints can be enabled as a conditional breakpoint over CDP, where the passed expression simply is
console.log(<x>)which will get evaluated in the scope of where the breakpoint hauls execution. The log message should then be surfaced in the Debug Console, as this is already working. -
LogPoints should be set using a UX that is similar to the conditional breakpoint logic, but use a different gutter icon.
-
The expression of a LogPoint should be validated to make sure it can be executed
Asks outside of this DA:
VS code:
- Support an extension point for customizing gutter interaction.. Support an extension point for customizing gutter interaction. vscode#38568
- Visualize breakpoint types in breakpoints view to enable LogPoints to show up as LogPoints instead of a conditional breakpoint, Visualize breakpoint types in breakpoints viewlet vscode#42266
VS Code Debug Protocol
- Enable debug adaptors to enable/disable certain breakpoint types. Enable debug adaptors to enable/disable certain breakpoint types vscode-debugadapter-node#155
Considerations:
- Should we treat LogPoints as a special kind of breakpoint or something new? Do we want do introduce a
Debugger.addLogPointin CDP and move the responsibility on level deeper, or have the implementation in inside this DA? Does the Debug Protocol (DAP) need to be extended?
(@dhanvikapila, @digeff, @changsi-an, @roblourens, @weinand )