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 online Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Simple answer: No

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: Thu Apr 25 16:40:14 GMT 2024

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

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

Back to the top