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: 13666
Registered: July 2009
Senior Member
Simple answer: No

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:Change Default size of hover
Next Topic:[xbase] how to define an array
Goto Forum:

Current Time: Tue Dec 01 16:23:53 GMT 2020

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

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

Back to the top