|
|
|
|
Re: Documenting the Grammar to use it in the DSL-Editor [message #1142498 is a reply to message #1142419] |
Thu, 17 October 2013 17:14 |
|
Hi,
i do not understand your problem
org.eclipse.xtext.ui.editor.hover.html.DefaultEObjectHoverProvider.getHoverInfo(EObject, IRegion, XtextBrowserInformationControlInput)
is the point to calc the hover.
the other problem is: the mechanism has to be called at all.
this is prohibited by org.eclipse.xtext.ui.editor.hover.AbstractEObjectHover.getXtextElementAt(XtextResource, int)
since it calls org.eclipse.xtext.resource.ILocationInFileProvider.getSignificantTextRegion(EObject)
and the significant region is the name place only.
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: Documenting the Grammar to use it in the DSL-Editor [message #1143856 is a reply to message #1081526] |
Fri, 18 October 2013 13:21 |
Björn Rellesch Messages: 38 Registered: January 2013 |
Member |
|
|
Hi,
I fixed the Problem.
As I mentinoned before I followed the posting:
http://blogs.itemis.de/stundzig/archives/868
To get a documentation formatted in html I added the following line in my DispatchingEObjectTextHover based on the example:
@Override
protected Pair<EObject, IRegion> getXtextElementAt(XtextResource resource,
int offset) {
//not a very good solution
Iterator<Object> iter = EcoreUtil.getAllContents(resource, false);
while (iter.hasNext()) {
if (iter .next() != null) {
someEObject= (EObject)iter.next();
break;
}
}
...
@Override
public Object getHoverInfo(EObject first, ITextViewer textViewer,
IRegion hoverRegion) {
if(first instanceof Keyword){
//not a very good solution
super.getHoverInfo(someEObject, oTextViewer, hoverRegion);
return getHoverInfoForKeyword((Keyword)first);
}else{
return super.getHoverInfo(first, textViewer, hoverRegion);
}
}
Greets Björn
[Updated on: Fri, 18 October 2013 13:22] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03354 seconds