-
Notifications
You must be signed in to change notification settings - Fork 109
Improve Quick Fix Hover to not hide Javadoc Hover #2687
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
base: master
Are you sure you want to change the base?
Conversation
|
Fix works like this. quick-fix-improvement.mp4 |
|
@iloveeclipse Currently we cannot select the Java Doc. I will try to improve that. It usually do not affect the current logic much. So please review this. I can include any feedback after that. |
5ef52d0 to
66599e7
Compare
|
Note: two failing tests are known, see #2685. @raghucssit : I'm not sure if there are any quickfix tests that open quickfix hover. Would be great to add one for the new functionality (nice to have, not a blocker). |
jjohnstn
left a comment
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.
It's a nice idea. In running a test, the window with the javadoc is too small but if I attempt to click on it, resize it, or try to scroll, it disappears. I did click on the quick-fix window which allows me to scroll through the quick-fix dialog but I cannot do anything with the additional dialog. It would also be nice for it to default its size to the same height as the quick-fix dialog - that doesn't fix my problem with having to scroll but it would look cleaner.
66599e7 to
d12eb77
Compare
Yes.. I agree with your observation I have already mentioned that. quick-fix-improvement.mp4Regarding size: For me size seems to be alright. Do you see very small popup ? I have used calculate preferred size API to calculate the size. |
d12eb77 to
8d49a6a
Compare
|
Hi @raghucssit I tried the latest version. The dialog now stays when the quick-fix dialog is clicked. In one example, the size of the dialog was quite reasonable, in another, it made it a little too small and added a horizontal scroll bar.
I suspect this is some issue in swt. I also notice that your dialog has a better height than the quick-fix hover (your height is always the height of the original plus the added control at the bottom). I actually think the quick-fix hover should be changed to the same height as it usually slightly clips the bottom of the last suggested quick-fix. That said, I also notice if I click on the new dialog to do resizing or scrolling, the original dialog disappears. I think it should remain open until the user clicks on a quick-fix or else clicks back in the edit area. |
iloveeclipse
left a comment
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.
I will push cleanup on top as temporary commit
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
8d49a6a to
b93ca3b
Compare
|
I've tried to improve the way how the hover is shown (it wasn't always shown for me very often) and also to change it to show immediately, not on mouse move only. |
b93ca3b to
373f93c
Compare
|
New fix looks like this. javadoc-as-quick-fix-proposal.mp4This can be tweaked to show the link in other place or add is as toolbar item. But this fix looks stable. |
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.
Pull request overview
This PR improves the Quick Fix Hover functionality by adding a Javadoc proposal that allows users to view documentation for Java elements without losing the quick fix hover. When hovering over an annotation with quick fixes, users can now click on a "Open Javadoc" link to display the element's documentation in a separate hover window.
Changes:
- Added a new Javadoc proposal to the quick fix hover that displays element documentation
- Introduced hover bounds tracking to position the Javadoc hover relative to the quick fix hover
- Added localized message string for the Javadoc proposal display text
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
| AbstractAnnotationHover.java | Implements the new Javadoc proposal creation logic, bounds tracking, and hover display functionality |
| JavaHoverMessages.java | Adds the message key for the Javadoc proposal display string |
| JavaHoverMessages.properties | Defines the localized message text for the Javadoc proposal |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaHoverMessages.properties
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
0cdcad0 to
ffc9b4d
Compare
|
@iloveeclipse This PR is ready to review. Please take a look. |
|
Note: the last commit was not tested at all (no build triggered) due https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/7060. |
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaHoverMessages.properties
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Show resolved
Hide resolved
|
Here is the example snippet I've used for testing this PR |
|
@raghucssit : please check the commit I've pushed on top of yours & if you are OK, squash both to one. |
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Show resolved
Hide resolved
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractAnnotationHover.java
Outdated
Show resolved
Hide resolved
Quick Fix Hover blocks the Java Doc Hover for the Java Element. It makes it difficult to choose right quick fix without knowing about the Java Element. So we Add a new "Open Javadoc" completion proposal to the annotation hover and make it the first proposal. see eclipse-jdt#2673
268f466 to
73cf6e1
Compare
|
@iloveeclipse Thanks for your commit. Changes looks good. I also have addressed remaining review comments. |

Quick Fix Hover blocks the Java Doc Hover for the Java Element. It makes it difficult to choose right quick fix without knowing about the Java Element. So we create a Java Doc Hover when user hovers on Quick Fix Hover.
see #2673