Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content assist and validation(Content assist and validation)
Content assist and validation [message #901359] Sat, 11 August 2012 12:06 Go to next message
Stefan Nikolic is currently offline Stefan NikolicFriend
Messages: 2
Registered: May 2012
Junior Member
Hello everyone,

I have a question about customizing content assist in Xtext.

I have defined grammar for my DSL named 'ISDesLanguage'. Also, I did some custom validation
by defining number of semantic constraints in class 'ISDesLanguageJavaValidator'.
Everythig works fine, except that content assist do not take into consideration these semantic constraints.

For example, if I have grammar:

Project : "Project" name=ID "{"
"Items" "{" (items+=Item)*"}"
"ItemSets" "{" (itemSets+=ItemSet)*"}"
"}";
Item : "Item" name=ID ;
ItemSet: "ItemSet" name=ID "{"(items+=[Item])* "}";

And if I introduce validation constraint that each item can be included in maximum one item set,
then validation works fine, but content assist still proposes every single item as a candidate
for including in every item set.

I am wondering what is the best way to include these semantic constraints from validator in content assist?
I know that customization of content assist is done by (re)defining methods in class 'ISDesLanguageProposalProvider'.
Is there some given way to simply attach 'ISDesLanguageJavaValidator' to 'ISDesLanguageProposalProvider', or I will
have to implement these semantics again in 'ISDesLanguageProposalProvider'?

Thank you in advance, Stefan.
Re: Content assist and validation [message #901361 is a reply to message #901359] Sat, 11 August 2012 12:20 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13493
Registered: July 2009
Senior Member
Simple answer: No

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:Change Default size of hover
Next Topic:[xbase] how to define an array
Goto Forum:
  


Current Time: Sun Jul 12 01:09:50 GMT 2020

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

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

Back to the top