Skip to main content



      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 04:26 Go to next message
Eclipse UserFriend
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 04:52 Go to previous messageGo to next message
Eclipse UserFriend
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 05:42 Go to previous messageGo to next message
Eclipse UserFriend
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 06:33 Go to previous messageGo to next message
Eclipse UserFriend
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 07:04 Go to previous messageGo to next message
Eclipse UserFriend
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 07:37 Go to previous messageGo to next message
Eclipse UserFriend
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 07:44 Go to previous messageGo to next message
Eclipse UserFriend
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 07:55 Go to previous messageGo to next message
Eclipse UserFriend
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 10:26 Go to previous messageGo to next message
Eclipse UserFriend
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 10:47 Go to previous messageGo to next message
Eclipse UserFriend
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 12:33 Go to previous messageGo to next message
Eclipse UserFriend
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 14:23 Go to previous message
Eclipse UserFriend
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:@Check validations not being executed
Next Topic:Xtend2: extended type-based collection filters
Goto Forum:
  


Current Time: Wed Jul 23 19:36:02 EDT 2025

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

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

Back to the top