Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to display multiple errors for same objects used more than once
How to display multiple errors for same objects used more than once [message #893255] Tue, 03 July 2012 11:27 Go to next message
Latha Shankara is currently offline Latha ShankaraFriend
Messages: 33
Registered: June 2012
Member
Hi All,

I have a problem in highlighting errors (underlining errors with red line)for same objects used more than once.

I have code as below,

implement Dummy, Dummy, Dummy of Expansion;

I have implemented code to display errors for all the three elements (Dummy, Dummy, Dummy). The message appears thrice as expected however only the first element is underlined red where as I want all the three Dummy elements to be underlined red.

It works fine if Dummy is used in different line like the below code,

implement Dummy of Expansion;
implement Dummy of Expansion;

Could anyone please suggest a way to tackle this?

Re: How to display multiple errors for same objects used more than once [message #893386 is a reply to message #893255] Tue, 03 July 2012 19:15 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

in more recent versions of Xtext you can add the index of a list feature that is to be marked with the error. So rather than using
error(String message, EStructuralFeature feature)
you use
error(String message, EStructuralFeature feature, int index) using the appropriate index for every Dummy.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: How to display multiple errors for same objects used more than once [message #893414 is a reply to message #893255] Wed, 04 July 2012 03:31 Go to previous messageGo to next message
Latha Shankara is currently offline Latha ShankaraFriend
Messages: 33
Registered: June 2012
Member
Hi Alexander,

Thanks for your answer! That did help but another problem occurs.

Now if I have,

implement Dummy, Dummy1, Dummy2 of Expansion;
implement Dummy1 of Expansion;

In the first line of code, Dummy1 is marked error which is right but in the second line the entire line is marked error instead of only Dummy1.

What could be the problem?
Re: How to display multiple errors for same objects used more than once [message #893423 is a reply to message #893414] Wed, 04 July 2012 06:00 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

hard to tell without known the grammar and the validator code. Are you sure, that the calculated index for the second Dummy1 is correct?

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Previous Topic:How to create non-printable ASCII chars as terminal rules?
Next Topic:Lazy Linking is broken in 2.3
Goto Forum:
  


Current Time: Sat Feb 22 23:47:07 GMT 2020

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

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

Back to the top