-
Notifications
You must be signed in to change notification settings - Fork 2.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
12970 Fixes hover widget jumping #12971
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution! Your changes definitely improve the current state and work quite well.
However, I found a few scenarios where the positioning is strange with the Mock Debug Adapter extension.
- when hovering above a variable and then move the the outer right of a variable, at some point the widget jumps to horizontal position
0
. I could not reproduce this withmaster
.
Peek.2023-10-10.16-27.mp4
- sometimes the vertical position is misplaced, but I can reproduce this effect also without this change, so it is likely unrelated.
Peek.2023-10-10.16-29.mp4
Finally, just a style nitpick: I think it may be worth extracting the code you added into an own method, as you eventually just update this.options.selection
and the method is already very long. This way you could avoid making this long method even longer and assign a meaningful name to your code.
@planger Okey, I'll think about moving code to the method ) I've just fixed wrong behavior, showed in the first video) |
Thank you for looking into this again! However, now your change doesn't seem to have an impact for my test with the mock debug extension anymore, as the condition on line 180 is true, so your code is never executed. Or am I missing something? Can you please take another look? Thank you very much! |
@planger Yeah, this is correct. In your situation my code, probably, should not work. Mock Debug Extension has its own ExpressionProvider My main scenario - we don't have any ExpressionProvider, just pure Editor and model, but I have tested the latest version of MockDebug without any changes, DebugWidget is not jumping after pointer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zebsterpasha Ok thanks, makes sense! I don't have objections to your changes and they already improve the situation in the context of the scenario you describe. So I'll go ahead and approve this PR to avoid offloading more on to your fix.
However, I think at least mid-term we should expand this work to improve the situation for all scenarios of debug hovers. At least for me with the MockDebugExtension (with and without your changes), the debug hover behavior is not ideal.
- It follows the pointer if moved above an expression
- It is not always nicely rendered vertically (above or below the expression but sometimes covers the expression)
- It is sometimes placed very weirdly
Peek.2023-10-12.13-06.mp4
@Zebsterpasha If you have the chance to additionally investigate the scenarios above for all debug hover cases, as you are already familiar with this code, we'd be very grateful! If you can't do that, we can merge this change and I'll open a new ticket for the future improvements.
Thanks again for your valuable contribution!
@planger Okey, thank you! I agree with you, sometimes the behavior is a little bit wierd, but transferred position in document is correct, maybe this is an editor's issue) Possibly, the convertation of the Position in editor to the Position on the screen is going wrong, depending on the position of the pointer. I think that is better to merge this request into the master and open the new one, because of different type of error. |
Alright, I've opened #12994 |
What it does
Fixes #12970
How to test
Follow-ups
Review checklist
Reminder for reviewers