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 offline Christian DietrichFriend
Messages: 14665
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


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 offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
The documentation provider

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: Thu Apr 25 01:21:27 GMT 2024

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

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

Back to the top