-
Notifications
You must be signed in to change notification settings - Fork 29.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breakpoints on particular column #14784
Comments
Agree that this is a nice feature to have. As for managing breakpoints I propose the following:
As for representing them I think we have two options: Put a decoration on the exact line / column locationThis approach is being done by Chrome, more details can be found here We could only use this in column decorations when there is > 1 breakpoint on that line. Otherwise just decorate the margin and on hover show the column location. Always only show an icon in the glyph margin
In both cases breakpoints view would nicely show the column for each breakpoint |
There's going to be a problem in the short term with this in Node/Chrome that I didn't see- from this bug, microsoft/vscode-node-debug2#71, I realized that if you set a bp towards the end of a line (after the last valid break location, I guess) Chrome will actually set it on the next line. Filed this on V8, then realized that there's a brand new protocol API to cover this exact case, getPossibleBreakpoints. However it only exists in Canary at the moment. Probably will be available in Node 8 or later in 7.x. I filed microsoft/vscode-chrome-debug-core#144 on myself to use this API, and fall back on the old behavior when needed. I didn't realize they were working on this in Chrome devtools - thanks for posting the link. I can have this set up to light up in any runtime that supports that API. |
I propose that we revisit this for Feb or March, when we'll have this API in Chrome and Node. In the meantime I'll have to ignore the column coming from vscode (or we can revert 604e21b) |
@roblourens agree to push this out for Feb and March |
Sounds good, thanks. |
@delmyers @gregg-miskelly @MSLaguana @DanTup @devoncarew @WebFreak001 @roblourens @andysterland @hbenl @lukaszunity @svaarala @ramya-rao-a @vadimcn @felixfbecker @daviwil @rkeithhill @DonJayamanne @rebornix We have introduced support for column breakpoints which you can try out in latest vscode insiders. If your debug adapter already supports column breakpoints then everything should work nicely out of the box - just try it out in vscode insiders. |
XDebug doesn't support column breakpoints unfortunately. |
@felixfbecker then make sure to return a breakpoint without a |
GDB, LLDB and Mago don't support this. tbh I think column breakpoints aren't really a useful feature, more like a feature that looks cool the first time you see it but then never touch it again. |
@WebFreak001 it is very useful for breaking inside arrow functions in JS like [1, 2, 3].map(x => x * 2) |
@felixfbecker exactly, that's a good example where this feature shines. |
Well I can't really think of anything you would want to debug there because those functions are often very simple and not really a debugging target. Well but I guess for scripting languages where you often put multiple statements in one line it makes sense, but for native languages this wouldn't work most of the time anyway, as most of them only store a line/instruction pointer map (or something similar) for the debugger |
@isidorn I don't believe Python supports this either, hence no changes in the Python debugger. |
@WebFreak001 Just must have not worked with these often then. If you work with promises, you can have a promise chain with a dozen of these, and it is extremely valuable being able to break at each step in the chain and inspecting the results. |
Cool! PowerShell supports column breakpoints. I'll look into adding support for this in the PowerShell debugger. cc @daviwil |
Nice :) |
We are still working on the final UI, but this won't affect debug adapters. |
PR submitted. The next drop of PowerShell will support column breakpoints once the next version of VSCode drops. |
There might be an issue for this already but I can't find one, so here's a general feature request for discussion.
It would be very useful to be able to set a breakpoint on a particular column of a line. It's useful for debugging promises -
or minified code -
especially since we don't have any way to pretty-print scripts while debugging them. As is, there's no way to break inside the
then
s or on expressions that are packed on the same line without reformatting your code or setting breakpoints in other places.This is handled by the protocol already but needs UI work.
And a cheaper way to experiment with this could be to change the "Run to cursor" option to respect the column.
The text was updated successfully, but these errors were encountered: