-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Improving the UI for "step in targets" #149871
Comments
Makes sense to me 👍 |
I see there is some discussion about this in the other issue but did you work out how to come up with targets for js-debug? Ignoring getters doesn't seem great to me but there's probably no way around that |
@connor4312 yes, I was thinking of your option 2 when working on the DAP proposal initially. Ideally the cursor position would determine the target for the "step in". May be it is not even necessary to have a new "step in targets" action in the toolbar: if the cursor is in a valid "step-in-target" range, then VS Code will automatically use "step in target" instead of "step in". Since I didn't want to add additional "position" properties to the DAP request, I decided to start simple and add more properties when needed. |
I wouldn't want to trigger it on accident. Especially tricky since we move the cursor to the paused location as you step. |
I agree that this isn't very obvious to me. If I didn't know about step in targets I would probably be quite confused if this happened. We could always have the button in the debug toolbar be under an |
@roblourens @connor4312 you both have convinced me that a "step in targets" only based on caret position is too much magic and might be confusing. |
Verified using mock debug. I didn't see a new button in the debug toolbar, but I verified from the context menu and from the command palette. |
Yes, it's supported. We exclude the location you're currently paused at, though we could special case that to just do an ordinary "step in". I'll make an issue for it. |
Nvm, it works here:
Very cool. However, a modified+click solution would be the icing on the cake. |
Agreed 🙂 Some polish next iteration I think |
On my plate is @hediet's Debugger: Smart Step Into issue. We already support this in DAP via the step in targets, but the UI in VS Code could use some polish.
Today, step in targets is only surfaced through a context menu actions that are available when paused and
supportsStepInTargetsRequest
is true:The result of this is a context menu, which allows the user to select one of the targets by their
label
I suggest the following:
Add the command to the
command palette(added in debug: improve step in target UI #152131) and Debug toolbar. This is our "step in" iconMaybe an icon like this would work:
Alternatively we could use a dropdown button, but I'm not the biggest fan of throwing those around everywhere, especially for actions the user may want to repeat frequently.
Allow for the step in range to be correlated with a position on the line. Currently the StepInTarget only has a label. We could match that as text to contents of the line, but this wouldn't work if there's repetitive content like
find
infind(arr1, a => find(arr2, a => a == b)
Therefore, I suggest (and will if we agree on a direction!) making a proposal to add an option
line
,column
,endLine
, andendColumn
options to theStepInTarget
akin to theGoToTarget
. Proposed in Add additional location information to StepInTarget debug-adapter-protocol#274With that change, we can now have commands to step into the target in the current cursor position. When the "step in targets" command/button is executed, it can open quickpick. As items in the quickpick are focused, the editor reveals and selects the document range that the target refers to.(added in debug: improve step in target UI #152131)The text was updated successfully, but these errors were encountered: