Skip to content

Conversation

@raghucssit
Copy link
Contributor

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

@raghucssit
Copy link
Contributor Author

Fix works like this.

quick-fix-improvement.mp4

@raghucssit
Copy link
Contributor Author

@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.

@iloveeclipse
Copy link
Member

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).

Copy link
Contributor

@jjohnstn jjohnstn left a 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.

@raghucssit
Copy link
Contributor Author

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.

Yes.. I agree with your observation I have already mentioned that.
Now I have improved the code to select the new Java Doc Popup.. However user has to first select and focus quick fix in order to select the Java Doc. This is because even the quick hover disappears if use changes selection on editor so if quick fix has click selection then java doc can also be selected.
Here is the fixed demo.

quick-fix-improvement.mp4

Regarding 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.

@jjohnstn
Copy link
Contributor

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.

Screenshot From 2025-12-12 13-27-20

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.

Copy link
Member

@iloveeclipse iloveeclipse left a 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

@iloveeclipse
Copy link
Member

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.
What I didn't get is to make sure the javadoc stays reliably if focused by the user.
This must be improved.

Copilot AI review requested due to automatic review settings January 13, 2026 23:40
@raghucssit
Copy link
Contributor Author

New fix looks like this.

javadoc-as-quick-fix-proposal.mp4

This can be tweaked to show the link in other place or add is as toolbar item. But this fix looks stable.

Copy link

Copilot AI left a 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.

@raghucssit raghucssit force-pushed the quick-fix-java-doc branch 2 times, most recently from 0cdcad0 to ffc9b4d Compare January 20, 2026 09:07
@raghucssit
Copy link
Contributor Author

@iloveeclipse This PR is ready to review. Please take a look.
Build is unstable. But successful. Seems some build machine issue.

@iloveeclipse
Copy link
Member

Note: the last commit was not tested at all (no build triggered) due https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/7060.

@iloveeclipse
Copy link
Member

Here is the example snippet I've used for testing this PR

import java.util.Date;

public class DeprecatedApiUse {

	public static void main(String[] args) {
		int someCode = Hello.someCode();
		someCode = Hello.someCode2();
		someCode = Hello.someCode3();
		someCode = Hello.someCode4();
		Date date = new Date();
		someCode = date.getYear();
	}
}

/**
 * Very useful code
 */
@Deprecated
class Hello {
	/**
	 * Very useful code
	 * @deprecated
	 */
	static int someCode() {
		return 42;
	}
	
	/**
	 * Very useful code
	 * @deprecated As of JDK version 1.1,
     * replaced by {@code Calendar.get(Calendar.YEAR) - 1900}.
	 */
	static int someCode2() {
		return 42;
	}
	
	/**
	 * Very useful code
	 */
	@Deprecated(forRemoval = true, since = "Some unusual version")
	static int someCode3() {
		return 42;
	}
	
	/**
	 * Don't use me anymore please.
	 * <p>
	 * Don't use me anymore please.
	 * <p>
	 * Don't use me anymore please.
	 * <p>
	 * Don't use me anymore please.
	 * <p>
	 * Don't use me anymore please.
	 * @deprecated It was some very useful code, very useful, very very useful, no doubt it was useful
	 */
	static int someCode4() {
		return 42;
	}
}

@iloveeclipse
Copy link
Member

@raghucssit : please check the commit I've pushed on top of yours & if you are OK, squash both to one.
I haven't fixed everything I've mentioned, so please check all my comments.

Copy link

Copilot AI left a 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.

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
@raghucssit
Copy link
Contributor Author

@iloveeclipse Thanks for your commit. Changes looks good. I also have addressed remaining review comments.
Functionality looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants