Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] text hovers

Thanks for clarifying. It seems like being able to specify a priority would provide more certainty, or being able to switch providers around to suit context might also be useful…

Regards,
Greg 

On Sep 22, 2016, at 4:42 AM, Jonah Graham <jonah@xxxxxxxxxxxxxxxx> wrote:

Hi Greg,

In addition to what Marc said, the sort is not by label, but by dependencies of plugins which contain them, with special case exceptions (like combined aka best match and annotation). The code is here, where you can see the exception details in the comments: https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java#n894 However the hovers are actually sorted twice, first by label and then by configuration element. So by design or not, elements with the same dependency info are sorted by labels: https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/core//org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CEditorTextHoverDescriptor.java#n200 Of course those labels my be l10n so the sort order in a different language could be different.

Frankly sorting these by plug-in deps is a little strange. I suspect it has to do with some lazy loading optimization decisions, but it is certainly not obvious to the user what is happening.

For history the CDT implementation was copied from the JDT one, with one addition being the sort by label. This came up earlier this year as PyDev was improving hover support, including adding multiple hovers and solving the priority problem. The PyDev implementation is an improvement of the JDT/CDT ones. Here is a message from pydev's dev list that may help: https://sourceforge.net/p/pydev/mailman/message/34779659/

Jonah


~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com

On 21 September 2016 at 20:40, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx> wrote:

We use a 'fake' hover listed first, which chooses smartly between all other hovers.

The code is in o.e.cdt.ui and its the class BestMatchHover.java


Marc



From: cdt-dev-bounces@xxxxxxxxxxx <cdt-dev-bounces@xxxxxxxxxxx> on behalf of Greg Watson <g.watson@xxxxxxxxxxxx>
Sent: September 21, 2016 1:05 PM
To: CDT General developers list.
Subject: [cdt-dev] text hovers
 
I’ve been trying to understand how the debugger text hover gets preference over the other types of hovers that the C editor provides. As far as I can tell, the hover providers are sorted by their labels (apart from “Annotation” which gets installed last, and “Combined” which gets installed first), so it’s just luck that the description “Debugger” comes before the other hovers (e.g. “Documentation”). Can anyone confirm this is the case?

Thanks,
Greg

 
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev
Mailing list: cdt-dev CDT General developers list. About cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top