Skip to main content



      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 07:27 Go to next message
Eclipse UserFriend
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 15:15 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: How to display multiple errors for same objects used more than once [message #893414 is a reply to message #893255] Tue, 03 July 2012 23:31 Go to previous messageGo to next message
Eclipse UserFriend
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 02:00 Go to previous message
Eclipse UserFriend
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
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 Jul 12 00:42:50 EDT 2025

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

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

Back to the top