Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Hover information support in Xtext Web editor
Hover information support in Xtext Web editor [message #1808669] Fri, 28 June 2019 12:51 Go to next message
Dmitry Gubin is currently offline Dmitry GubinFriend
Messages: 3
Registered: June 2019
Junior Member
Dear Xtext experts,

At first thanks a lot for such an awesome technology and tools built around it!

We are planning to use Xtext technology for building custom DSL. It has to contain set of predefined functions that will utilise boolean logic comparison, addition negation of its results.

We are using Orion web editor as a target UI component for end-user usage.
So as an example in web-editor moderator has to type smth like this:

if (func1("stringParam1") AND func2(10)) {
   if (func3("stringParam3") <= 7 OR func4(42)  = "SomeValueForComparsion") {
      return true
   }
}
return false


As a part of our requirements we have to implement hover functionality in order to provide the information for the end-user let's say about function
func1("stringParam1"). As I read from the Xtext documentation it should work with help of 'IEObjectDocumentationProvider' (https://www.eclipse.org/Xtext/documentation/330_web_support.html#hover-info) and I've put some ML_COMMENT's into MyDSLGrammar.xtext files but looks like it doesn't work for me for some reason. I've tried to debug 'org.eclipse.xtext.documentation.impl.MultiLineCommentDocumentationProvider' that is an actuial the implementer of IEObjectDocumentationProvider interface but it always leaves the function at

if (!leafNode.isHidden())
	break;


condition and never adds any documentation. I've attached the screenshot to make it clear what I want to achieve (in short I want to add some documentation for the func2: `func2 does blabla`)



Do you have any hints for me on how I should implement it in a proper way ?

Thanks in advance, Dima.

Re: Hover information support in Xtext Web editor [message #1808670 is a reply to message #1808669] Fri, 28 June 2019 12:55 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
You understand something wrong
It shows the comment of the thing
In the model file not the grammar

/** this is very nice thing */
Define thing


....
Use thing // over on thing here will give you the comment

For everything else you have to customize the behavior


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Hover information support in Xtext Web editor [message #1808679 is a reply to message #1808670] Fri, 28 June 2019 13:37 Go to previous messageGo to next message
Dmitry Gubin is currently offline Dmitry GubinFriend
Messages: 3
Registered: June 2019
Junior Member
Hi Christian,

Thanks. Yes I got the idea. But looks like I need to have function declaration predefined somehow together with comments for it before the web-editor loads on the page.
Do u know which functionality I should touch to override it somehow ?

Thanks, Dima.

Re: Hover information support in Xtext Web editor [message #1808683 is a reply to message #1808679] Fri, 28 June 2019 14:04 Go to previous message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
The documentation provider

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Cross referenced element name is getting replaced
Next Topic:XText Workflow for Expensive Analysis
Goto Forum:
  


Current Time: Fri Aug 23 19:46:19 GMT 2019

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

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

Back to the top