Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Validation adding to results each time
Validation adding to results each time [message #1039008] Thu, 11 April 2013 16:06 Go to next message
Sean McFee is currently offline Sean McFeeFriend
Messages: 2
Registered: April 2013
Junior Member
Hi guys,

I put in a custom validation rule in my Dsl's AbstractMyDslJavaValidator:

@Check(CheckType.EXPENSIVE)
public void checkMyObjectIsAwesome(MyObject decl ) {
warning("This content might not be awesome", MyObjectDslPackage.Literals.MY_OBJECT__CONTENT);
}

The first time I validate, all is well; I can get problem markers for each of my MyObjects.

The second time I validate, my number of problem markers has doubled. The third time, they have tripled. In essence, the problem markers from my previous validation operations are sticking around when I re-validate.

My previous experience with the various EMF-based validation frameworks is that subsequent validations after the first do not do this. In any case, I'd like to figure out how to make it not do this Smile. All my Xtext project settings are fairly standard. Any guidance would be appreciated.

Regards,
Sean
Re: Validation adding to results each time [message #1039110 is a reply to message #1039008] Thu, 11 April 2013 19:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6552
Registered: July 2009
Senior Member
Hi,

do you have build automatically on?
Re: Validation adding to results each time [message #1039117 is a reply to message #1039110] Thu, 11 April 2013 19:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6552
Registered: July 2009
Senior Member
P.S: can you share a complete reproduceable example?
Re: Validation adding to results each time [message #1039124 is a reply to message #1039117] Thu, 11 April 2013 19:49 Go to previous messageGo to next message
Sean McFee is currently offline Sean McFeeFriend
Messages: 2
Registered: April 2013
Junior Member
"Build automatically" is on although I'm not sure why that would make a difference when I am not actually building anything. Unless you're asking if I have it on in my development workspace, which I do Smile.

I would prefer not to produce a complete reproduceable example since I would have to do it from scratch to not have any proprietary IPs in it. The part I put above is the part that is salient; I am calling AbstractDeclarativeValidator.warning(String, EStructuralFeature) on the same unchanged resource, and the problem markers are getting duplicated. I'm assuming there is some logic somewhere that says "We already have that problem marker, we don't need it again", and it is not working. This logic does exist in older versions of Eclipse and I'm guessing it's still supposed to.
Re: Validation adding to results each time [message #1039129 is a reply to message #1039124] Thu, 11 April 2013 19:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6552
Registered: July 2009
Senior Member
Hi,

you dont use the existing trigger button (triggers org.eclipse.xtext.ui.editor.handler.ValidateActionHandler) ???
i tried to reproduce it with the greeting example but it works as expected

[Updated on: Thu, 11 April 2013 19:57]

Report message to a moderator

Re: Validation adding to results each time [message #1039133 is a reply to message #1039129] Thu, 11 April 2013 20:00 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6552
Registered: July 2009
Senior Member
P.S: you may debug into org.eclipse.xtext.ui.editor.validation.AddMarkersOperation
Previous Topic:Cannot seem to properly reference
Next Topic:create a project
Goto Forum:
  


Current Time: Mon Dec 22 23:28:27 GMT 2014

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

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