eclipse-platform / eclipse.platform.ui

Eclipse Platform UI - a comprehensive set of frameworks and common services that collectively provide a powerful software development infrastructure.
https://eclipse.dev/eclipse/
Eclipse Public License 2.0
96 stars 210 forks source link

Maven "pom.xml": popup for validation warning has wrong size #2909

Open WolfgangHG opened 1 month ago

WolfgangHG commented 1 month ago

I created a maven project from the archetype "org.wildfly.archetype:wildfly-jakartaee-webapp-archetype:35.0.1.Final", then I added three dependencies to pom.xml:

<dependency>
    <groupId>jakarta.servlet.jsp</groupId>
    <artifactId>jakarta.servlet.jsp-api</artifactId>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>org.glassfish.web</groupId>
    <artifactId>jakarta.servlet.jsp.jstl</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>jakarta.servlet.jsp.jstl</groupId>
    <artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

One dependency has a unnecessary "version" element. So a warning "Overriding managed version 3.0.2 for jakarta.servlet.jsp.jstl-api" is reported. The popuop when hovering over the warning text has a wrong size.

When hovering over "version", the message is completely visible, but when resizing the popup, additional info about the "version" element becomes visible. Is this intended? Image

When hovering over the text content of "version", the message is clipped. A second warning is shown when resizing it:

Image

Hope this the right place to report it. Some time ago I reported a similar "popup is too small" problem for the xml editor (https://www.github.com/eclipse-lsp4e/lsp4e/issues/214) and was told to report it here. But as I could not reproduce the issue, I did not do this ;-). Anyway, in the other issue it was suggested that it might be related to multiple warnings in one place, and the second warning could be such a case, as there are two messages.

merks commented 1 month ago

I know from experience that getting the hover to be a nice size is a challenge at best. The framework just doesn't do such a great job supporting this. It depends on calls to org.eclipse.jface.text.AbstractInformationControl.setSizeConstraints(int, int) which gets info from org.eclipse.jface.internal.text.InformationControlReplacer.computeBoundsFromContent(IInformationControl, Rectangle) where things heavily depend on how the HTML is converted to text for which the size can be properly computed. Unfortunately I doubt anyone is going to fix this generic problem without the involvement of the framework that is producing this information.

It is possible to product larger results by investing more effort on the production side of things as we do for the hovers in Oomph setup editor:

Image

mickaelistria commented 1 month ago

Indeed, the issue is most likely caused by setSizeConstraints not receiving the right value. For this particular case in the description, the popup is a Composite of the usual error hover popup and a web browser showing the description (see CompositeInformationControl and CompositeInformationControlCreator). For the tests in org.eclipse.ui.genericeditor.tests, it should be possible to debug whether 2 "compound" hover do receive the right setSizeConstraint or similar. But IIRC (I'm not sure), the issue doesn't happen with "static" hover content, but happens very easily if the 2nd hover element is a Browser (like it's the case in the initial description).

Anyway, there is nothing easy to do here, except running a debugger on the CompositeInformationControl and family.

WolfgangHG commented 1 month ago

Unfortunately I doubt anyone is going to fix this generic problem without the involvement of the framework that is producing this information.

and

Anyway, there is nothing easy to do here, except running a debugger on the CompositeInformationControl and family.

I cannot help with debugging, being no Eclipse developer ;-).

Your comment sounds like the project which creates the message would have to handle this? So a new issue somewhere else?