Skip to content
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

Provide a way to show the editor hover while debugging #84561

Closed
testforstephen opened this issue Nov 12, 2019 · 18 comments
Closed

Provide a way to show the editor hover while debugging #84561

testforstephen opened this issue Nov 12, 2019 · 18 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan

Comments

@testforstephen
Copy link

Currently when your program stops at a breakpoint, hover on symbols will trigger evaluate DAP request automatically. And LSP doesn't receive hover request, so no way to show the javadoc during debugging.

Really like having a way to trigger the javadoc during debugging. It could be a shortcut to trigger javadoc manually. Or VS Code client intelligently determines sending the hover request to the correct server (DAP or LSP) based on the hover context. If the hover context is a variable, send to DAP, otherwise, to LSP.

@isidorn
Copy link
Contributor

isidorn commented Nov 14, 2019

The issue here is that debug hides all other hovers to show the debug custom hover.
Due to that the javadoc hover is not shown.

This is a design limitation of the debug.
However I will leave this open as a feature request to debug so we support this scenario in the future.
As you suggest, the user could explicitly trigger the regular hover.

@isidorn isidorn changed the title Provide a way to show javadoc during breakpoint debugging Provide a way to show the editor hover while debugging Nov 14, 2019
@isidorn isidorn added debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality labels Nov 14, 2019
@isidorn isidorn added this to the Backlog milestone Nov 14, 2019
@testforstephen
Copy link
Author

As you suggest, the user could explicitly trigger the regular hover.

The problem is it's not possible to trigger it manually, because the javadoc request is not exposed to user.

@Trass3r
Copy link

Trass3r commented Aug 26, 2020

Duplicate of #99856?

@isidorn
Copy link
Contributor

isidorn commented Aug 26, 2020

Actually this is an older issue, so closing that one.

@isidorn
Copy link
Contributor

isidorn commented Aug 26, 2020

Idea from @DanTup and @weinand use the alt key to switch between hovers

@Trass3r
Copy link

Trass3r commented Aug 26, 2020

I think Ctrl would be more natural for the fingers.

@isidorn
Copy link
Contributor

isidorn commented Aug 26, 2020

We use alt in other places in VS Code as a way to show "ALTernative" content

@DanTup
Copy link
Contributor

DanTup commented Aug 26, 2020

I don't know what it is on Windows, but on Mac if you hold down Cmd when hovering over symbols, it shows a preview of the definition. If this is Ctrl or Alt on Windows, it might be wise to avoid using the same one (otherwise the hover might be larger than expected because it'll have a code snippet in it too).

@isidorn
Copy link
Contributor

isidorn commented Sep 17, 2020

I have pushed the following change:
While debugging while a user is holding down the alt key we do not show the debug hover, but the regular editor hover.
I tried this out and seems to work quite nicely. But I would be interested a lot in feedback. So try it out with VS Code insiders from Friday and let me know how it goes. I will also present this in our daily team meeting to get more feedback, so still not closing this issue.

Some open questions:

  • How to make this alt behavior more discoverable
  • Is it frustrating to hold down alt key while reading a long JSDoc

Alternative approach would be to just have a global command that toggles the hover behavior. However this felt more "heavy" to me and I personally prefer the alt approach.

@DanTup Thanks for feedback. I have verified and on Windows this is Ctrl. So it seems like the alt key is free for this.

fyi @weinand @connor4312

@Trass3r
Copy link

Trass3r commented Sep 17, 2020

* How to make this `alt` behavior more discoverable

That would be my main concern too. Maybe there needs to be a 'status bar' in the popup reading "hold Alt for ...". I vaguely remember something like that from VS.

Alternative approach would be to just have a global command that toggles the hover behavior. However this felt more "heavy" to me and I personally prefer the alt approach.

You probably need to switch fast and often so that would be way too clumsy.

@DanTup
Copy link
Contributor

DanTup commented Sep 17, 2020

If something like that is done, it should be probably include the others (for example the Cmd/Ctrl behaviour I mentioned above). There are lots of little things like that that aren't very discoverable right now (I only found that one by accident because it was rendering badly due to some other issues).

@isidorn
Copy link
Contributor

isidorn commented Sep 17, 2020

Feedback from standup was positive. With the overall impression that the ideal solution would be to just show both the regular hover and the debug hover at the same time. However since this is currently not possible due to the way how editor layout hovers this alt approach is a good workaround.

Feedback once you try it out is very welcome.
Status in the debug hover just to always show "hold Alt..." message sounds like a bit too much, especialy since it does not bring value once user figures it out.

Initial work has been done thus closing

@isidorn isidorn closed this as completed Sep 17, 2020
@isidorn isidorn added the verification-needed Verification of issue is requested label Sep 17, 2020
@heartacker
Copy link
Contributor

if we can add an new pendant(little button?) to the debug popup, while debugging, show the debug popup when hovered, user will see the pendant.
than user can move The cursor to the pendant, then show the comments or infos from lsp. if there is no info, hide the pendant

@testforstephen
Copy link
Author

I tried ⌥ + hover in macOS, the javadoc for a symbol can pop up when debugging a Java program. But i see two issues for the fix:

  • Cannot pin the javadoc triggered by ⌥ + hover.
    If i release the key , the doc will disappear immediately. As comparison, in a normal hover ux, if the mouse focus is still on the widget and it will keep there. This is useful when reading a long doc.
  • ⌥ + hover will cause the normal hover action not working.
    Below are the reproduce steps:
    • Starting a debug session, and stop at a breakpoint.
    • Stop debugging session.
    • ⌥ + hover at a symbol.
    • hover at a symbol, no javadoc anymore.

A new global command to trigger javadoc at the selected symbol would be a good option. With this, you didn't need deal with the debugging state.

isidorn added a commit that referenced this issue Sep 18, 2020
@isidorn
Copy link
Contributor

isidorn commented Sep 18, 2020

I have pushed a smoother transitoin between the debug hover and the editor hover.

@testforstephen thanks a lot for trying out out.

  1. Good feedback. I will try to improve this right now
  2. I just pushed a fix for this

As for the global command I would only add this if this alt approach proves bad. Before that I would first think about making it more discoverable.

isidorn added a commit that referenced this issue Sep 18, 2020
…r hover and that the mouse move does not hide the regular hover

fixes #84561
@isidorn
Copy link
Contributor

isidorn commented Sep 18, 2020

I have also pushed a commit to tackle 1)

Please try it out with VS Code insiders from monday and let me know how it behaves now. Thanks a lot!

@testforstephen
Copy link
Author

@isidorn tried again, the latest insider works well.

@isidorn
Copy link
Contributor

isidorn commented Sep 21, 2020

Great! I will also create a small test plan item for this so we cover it in Endgame week.
#107156

@isidorn isidorn added on-testplan and removed verification-needed Verification of issue is requested labels Sep 21, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

No branches or pull requests

5 participants