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

Javadoc tooltips (hovering labels) are sometimes too small #1390

Open
vl-dp opened this issue May 6, 2024 · 3 comments
Open

Javadoc tooltips (hovering labels) are sometimes too small #1390

vl-dp opened this issue May 6, 2024 · 3 comments

Comments

@vl-dp
Copy link

vl-dp commented May 6, 2024

The Javadoc tooltips (hovering labels) adapt to the amount of documentation that is provided for the Java declaration in question, but the way the size of the labels is calculated could be improved. More precisely, quite often it is too short and will cut off, for example, a "@returns" clause of a Javadoc snippet, even if enough screen space is available. I understand that those labels should not waste space but I personally would find it helpful when viewing a Java methods documentation to see most of the relevant documentation clauses, like parameters and return value, without resizing the label.

I have attached parts of three screenshots to illustrate what I mean.

The first image shows how even for a tiny Java method with only two parameters and a short introductory sentence the "@return" clause is omitted from the initially visible contents of the tooltip:
javadoc_tooltip_returns_clause_cut_even_if_label_could_grow

The second image confirms that the labels size does in fact adapt to the amount of documentation. But as the documentation has grown, the label still cuts out relevant content, even though just a few more pixels in height would suffice to render the whole Javadoc snippet:
javadoc_tooltip_grown_but_now_throws_clause_is_cut

The final screenshot just shows, that if more elements of the same kind are added to a documentation snippet, the tooltip label also does grow, but a relevant "@returns" clause is still invisible:
javadoc_tooltip_cuts_of_returns_clause

I observe this behavior on Windows 10 with all recent Eclipse releases up to and including 2024-03 (precisely
Version: 2024-03 (4.31.0)
Build id: 20240307-1437
).

Only if consensus exists for that, I do suggest to render the complete Javadoc snippet that is provided for a Java declaration within Eclipses documentation tooltip (hovering label) unless a maximum size would be exceeded.

I'd like to link three related comments about Eclipses Javadoc tooltips that were made outside of Eclipses issue-tracking, which resemble my issue. I am not involved there in any way.

https://stackoverflow.com/questions/1988920/how-to-increase-content-assist-tooltip-size-in-eclipse-pdt
https://stackoverflow.com/questions/41315314/changing-the-default-size-of-the-docstring-hover-tooltip-in-eclipse-pydev
https://stackoverflow.com/questions/9735022/how-to-adjust-the-default-size-of-the-javadoc-popup-window-in-eclipse?rq=4

For reference, I previously submitted this issue to the old Eclipse-Bugzilla, which is still linked in this sub-projects documentation: https://bugs.eclipse.org/bugs/show_bug.cgi?id=331344
(There is no additional information from my side there)

@jukzi
Copy link
Contributor

jukzi commented May 13, 2024

@vl-dp can you provide a Pull request to make it any better?

@vl-dp
Copy link
Author

vl-dp commented May 15, 2024

@vl-dp can you provide a Pull request to make it any better?

No, unfortunately for the foreseeable future I can't. I'd be be new to the Eclipse source code and at the moment I cannot even compile the project. My try to setup and build the project in "Eclipse for Eclipse Committers" failed - there are many errors pertaining to missing or incompatible declarations. Maybe that is because the Eclipse Git repositories are in transition.

@XelaNimed
Copy link

XelaNimed commented May 27, 2024

@vl-dp In some cases, opening a JavaDoc in the browser helps me.
When the JavaDoc tooltip pops up, press F2 to switch focus from the code editor to the tooltip. After this, an icon for opening the JavaDoc in the browser will appear at the bottom of the tooltip.

image

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

No branches or pull requests

3 participants