Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/553653/#msg_553653
I am new to Eclipse as well as DLTK. I am developing an editor for a scripting langauge.

I want to enable function details display when mouse pointer hovers over a particular function. For this, I added an extension for "org.eclipse.dltk.ui.scriptDocumentationProviders" and implemented "IScriptDocumentationProvider" in the class that provides the extension. But I am not able to view any hover info when my mouse pointer hovers on the editor. Did I miss anything? I didnt do anything else for hover support other than providing the extension class.

While googling, I saw something like "you need to provide selection engine for using scriptDocumentationProviders extension". I then tried to implement a selection engine also by extending "ScriptSelectionEngine" but this too didnt give any result. I am not sure whether I implemented this selection engine in the correct way since I am not able to make out how to provide a link between selection engine and documentation provider.

I am using Eclipse 3.5 and DLTK 2.0.
Also please let me know the significance of "nature" field in the extension point in plugin.xml.

"nature" attribute is required so DLTK can distinguish extensions for your language from extensions for other languages.

However, it is impossible to say what happens in your code without debugging.
If you are still experiencing some issues please provide more details.

Regards,
Alex]]>Alex Panchenko2010-08-20T11:06:00-00:00Re: Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/555954/#msg_555954
Thank you for the reply.

As mentioned, I did implement "select" and "getInfo" functions in their respective classes. But in my case, I am not even getting the text hover event.

I have extended selection engine and documentation provider extension points.

Is there any place where I need to subscribe for the text hover event as we usually do in C#.Net?

Thanks,
Daisy.]]>daisydale852010-08-30T11:27:40-00:00Re: Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/555969/#msg_555969
You subscribe via extension points - classes contributed to these extension points are loaded by DLTK and the corresponding methods are called.

Unfortunately, it's not clear what happens in your environment.
Have you tried to debug to understand:
- if your classes are loaded?
- if appropriate methods are called?

Thanks,
Daisy]]>daisydale852010-08-31T11:52:54-00:00Re: Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/556234/#msg_556234
Defaults are initialized in (if you call it)

Usually org.eclipse.dltk.ui.BestMatchHover is called without any modifiers and it selects first hover which returns some content.

Regards,
Alex]]>Alex Panchenko2010-08-31T12:25:01-00:00Re: Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/556444/#msg_556444
"select" method call (function inside ISelectionEngine) which I got while pressing "Ctrl" key was not actually coming as part of text hover. When I checked the call stack, I understood that it is coming as part of detecting hyper link.

I am initializing the default preference values. But still I am not getting the hover event. I was able to get hold of the text hover event by implementing ITextHover interface. But I prefer doing it using ISelectionEngine itself since it is providing "F2" support also.

I will explain my requirement in case it is not clear.

I have a custom editor that is being developed for supporting a dynamic language. I am using DLTK for developing it. In the editor, when mouse hovers over a particular function/keyword, I want the help documentation to come which gives a brief description about the text over which mouse is hovering.

Thanks,
Daisy.
]]>daisydale852010-09-01T11:21:18-00:00Re: Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/557272/#msg_557272
]]>daisydale852010-09-06T11:54:43-00:00Re: Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/557347/#msg_557347
I would recommend to set breakpoint in

and try debugging it.
This class calls the other hovers and returns the matching one.

1st step is identifying if it's called.
2nd step is understanding if org.eclipse.dltk.internal.ui.text.hover.DocumentationHover is called from BestMatchHover
3rd step is understanding what's happening inside DocumentationHover

Regards,
Alex
]]>Alex Panchenko2010-09-07T02:58:23-00:00Re: Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/557433/#msg_557433
I did try to debug that. "getHoveInfo" function of BestMatchHover is not getting hit. Do I need to enable any settings anywhere so as to get the hover event? I am already calling "initializeDefaultValues" of preference constants. Is there any other value to set?

Thanks,
Daisy.]]>daisydale852010-09-07T12:02:49-00:00Re: Hover support in custom editorhttps://www.eclipse.org/forums/index.php/mv/msg/173927/557486/#msg_557486
Is it called in your setup?]]>Alex Panchenko2010-09-07T16:23:23-00:00