Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » No hovers in Fowler's State-Machine
No hovers in Fowler's State-Machine [message #1009528] Fri, 15 February 2013 09:26 Go to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi,

If I create the Martin Fowler example from within eclipse: "new->project->xtext->examples->xtext state-machine example", hovers are working with the mouse over in the editor and in content assist.


If however I create the Fowler DSL State Machine example as per Sven's blog (see: http://blog.efftinge.de/2011/06/five-simple-steps-to-fowlers-dsl-with.html), whilst the resultant project works insofar as content assist etc, there are no hovers within the editor or within content assist.

I'm sure I religiously followed the instructions in Sven's blog; please could someone explain why I am not seeing the hovers.

Many thanks,

Dan
Re: No hovers in Fowler's State-Machine [message #1009548 is a reply to message #1009528] Fri, 15 February 2013 09:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6315
Registered: July 2009
Senior Member
Hi,

the hovers should be there out of the box.
i just created a new Xtext Project, pasted the grammar, run the workflow, run the eclipse app and it works.
please note: hovers will only appear on names.

so did you change anything else?

~Christian
Re: No hovers in Fowler's State-Machine [message #1009577 is a reply to message #1009548] Fri, 15 February 2013 10:42 Go to previous messageGo to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi Christian,

Many thanks for your response.

No, I didn't change anything else; I followed exactly the steps in Sven's blog.

On the basis that I can get the example working from "new->project->xtext->examples->xtext state-machine example" seems to rule-out the Eclipse platform, however, FYI - I am running Version: Juno Service Release 1 Build id: 20121004-1855 and have installed xtext version 2.3.1.v201208210947.

In terms of testing the hover, I placed my mouse over an event in the editor; with the plug-in created via "new->project->xtext->examples->xtext state-machine example", all is well; with the one created via Sven's blog, no hover!!

Any pointers on how to determine what is wrong appreciated!

Many thanks

Dan
Re: No hovers in Fowler's State-Machine [message #1009610 is a reply to message #1009577] Fri, 15 February 2013 11:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6315
Registered: July 2009
Senior Member
Hi,

can you share your zipped code?

~Christian
Re: No hovers in Fowler's State-Machine [message #1009627 is a reply to message #1009610] Fri, 15 February 2013 12:04 Go to previous messageGo to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi Christian,

Thanks for your response.

I have zipped and attached as requested.

Many thanks,

Dan
Re: No hovers in Fowler's State-Machine [message #1009641 is a reply to message #1009627] Fri, 15 February 2013 12:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6315
Registered: July 2009
Senior Member
if i create a model

events
e1 code
end


and put on mouse on e1
i get a hover.
Re: No hovers in Fowler's State-Machine [message #1009644 is a reply to message #1009641] Fri, 15 February 2013 12:44 Go to previous messageGo to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi Christian,

I have just created the same event as you and I get no hover. Do you have any suggestions as to how I may be able to track down the problem?

Many thanks,

Dan
Re: No hovers in Fowler's State-Machine [message #1009649 is a reply to message #1009644] Fri, 15 February 2013 12:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6315
Registered: July 2009
Senior Member
Hi,

you may debug into the methods of DefaultEObjectHoverProvider
Re: No hovers in Fowler's State-Machine [message #1009718 is a reply to message #1009649] Fri, 15 February 2013 15:26 Go to previous messageGo to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi Christian,

Many thanks for the advice.

Dan
Re: No hovers in Fowler's State-Machine [message #1009728 is a reply to message #1009718] Fri, 15 February 2013 15:47 Go to previous messageGo to next message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi,

I have added MyDslEObjectHoverProvider as per blog http://christiandietrich.wordpress.com/2011/07/16/hover-support-in-xtext-2-0-tutorial/ and placed a break-point in method getFirstLine. Running under the debugger the break-point is never reached.

I also put an override on getHoverInfo and added a break-point, and again, the breakpoint is never reached.

Any further suggestions on the best place to focus on debugging ?

Many thanks

Dan
Re: No hovers in Fowler's State-Machine [message #1009778 is a reply to message #1009728] Fri, 15 February 2013 17:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6315
Registered: July 2009
Senior Member
HI,

it should work with zero customization. even with the greeting example.
here is a stacktrace to look for debug points

MultiLineCommentDocumentationProvider.getDocumentation(EObject) line: 121
DefaultHoverDocumentationProvider.getDocumentation(EObject) line: 25
DefaultEObjectHoverProvider.getDocumentation(EObject) line: 107
DefaultEObjectHoverProvider.getHoverInfoAsHtml(EObject) line: 80
DefaultEObjectHoverProvider.getHoverInfo(EObject, IRegion, XtextBrowserInformationControlInput) line: 91
DefaultEObjectHoverProvider$2.getInfo() line: 519
DispatchingEObjectTextHover.getHoverInfo(EObject, ITextViewer, IRegion) line: 38
AbstractEObjectHover$2.exec(XtextResource) line: 82
AbstractEObjectHover$2.exec(Object) line: 1
XtextDocument$XtextDocumentLocker(AbstractReadWriteAcces<P>).readOnly(IUnitOfWork<T,P>) line: 32
XtextDocument.readOnly(IUnitOfWork<T,XtextResource>) line: 78
DispatchingEObjectTextHover(AbstractEObjectHover).getHoverInfo2(ITextViewer, IRegion) line: 74
DefaultCompositeHover(AbstractCompositeHover).getHoverInfo2(ITextViewer, IRegion) line: 90
TextViewerHoverManager$4.run() line: 166

I Would start with org.eclipse.xtext.ui.editor.hover.AbstractCompositeHover.getHoverRegion(ITextViewer, int)

Re: No hovers in Fowler's State-Machine [message #1009817 is a reply to message #1009778] Fri, 15 February 2013 19:23 Go to previous message
Dan Simkins is currently offline Dan Simkins
Messages: 38
Registered: December 2012
Member
Hi Christian,

I tracked the problem down to the case sensitive nature of the file name extension. Initially I used a file name extension of ".myDsl" which resulted in no hovers. With a file name extension of ".mydsl", I get hovers. (the editor extension in the plugin.xml is "mydsl")

The root cause was in the isValid method in org.eclipse.xtext.resource.FileExtensionProvider. The hashmap contains "mydsl" and not "myDsl".

Many thanks for all your assistance.

Dan

Previous Topic:how to customize the XtextBuilder
Next Topic:Xtend2: extended type-based collection filters
Goto Forum:
  


Current Time: Tue Sep 23 12:27:27 GMT 2014

Powered by FUDForum. Page generated in 0.38637 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software