console-ninja icon indicating copy to clipboard operation
console-ninja copied to clipboard

[Feature]: Activate function logpoint with comment or something in the code itself

Open ck-coatue opened this issue 2 years ago • 1 comments

Describe the feature you'd like.

Function logpoints are so useful, but I'm way more used to printf debugging (console.log, trace, etc.) than setting breakpoints in vscode.

Also at least for me, breakpoint functionality in vscode is buggy. For example, right clicking on an existing breakpoint sometimes doesn't bring up the context menu to remove it. And then when it does work (usually by restarting vscode), attempting to remove them displays an error modal with "Cannot read properties of undefined (reading 'id')" most of the time.

ck-coatue avatar Mar 24 '23 18:03 ck-coatue

Triggering function logpoints via code is a good idea. We'll experiment a bit to find the best/intuitive way to trigger it.

For example, right clicking on an existing breakpoint sometimes doesn't bring up the context menu to remove it.

This is a known limitation of VS Code API/UX when rendering a line gutter icon makes the breakpoint icon not clickable. The suggested solution is to use F9 keyboard shortcut (or corresponding command(s) via VS Code command palette) to toggle the breakpoint.

attempting to remove them displays an error modal with "Cannot read properties of undefined (reading 'id')" most of the time.

This issue doesn't seem to be Console Ninja related. Can you please open VS Code Dev Tools (Developer: Open Webview Developer Tools) and share the stack trace for the error when it happens?

ArtemGovorov avatar Mar 28 '23 01:03 ArtemGovorov