Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to avoid validation trigger in Xtext(Validation in Xtext)
icon5.gif  How to avoid validation trigger in Xtext [message #1693872] Wed, 29 April 2015 03:59 Go to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
Hi All,
Suppose I am modifying a file, in the background all the validations which do not have CheckType.Normal will be called.

i.e. by default it will be CheckType.Fast. I want to avoid the validations if there are no real changes in the editor . Consider a case where I just enter a whitespace or a comment etc.

Can we achieve this ..?


Thanks for any help Smile


Arshad
Re: How to avoid validation trigger in Xtext [message #1693873 is a reply to message #1693872] Wed, 29 April 2015 04:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
why not using fast checks for checks that are fast so that it does not matter and normal checks for the rest?
you cannot detect if the change is whitespace only or not since the ast is (partially) recreated


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
icon5.gif  Re: How to avoid validation trigger in Xtext [message #1693874 is a reply to message #1693873] Wed, 29 April 2015 04:14 Go to previous messageGo to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
Hi Christian,

I have done it. But my CheckType.Normal checks takes longer time as my input data is huge. Hence the UI gets blocked.

Just wanted to know if I could achieve this in a better way.



Regards,
Arshad


Arshad
Re: How to avoid validation trigger in Xtext [message #1693875 is a reply to message #1693874] Wed, 29 April 2015 04:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hid you profile your validation?
e.g. for some n2 problems?

it may help you to find places on how to optimize the impl of the checks


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to avoid validation trigger in Xtext [message #1693907 is a reply to message #1693872] Wed, 29 April 2015 09:10 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

If your checks are so expensive and blocking, you should use also CheckType.EXPENSIVE. This is what it is for.
Use FAST only if you can do this on typing, normal on saving.
And right, prove if they could execute faster.

What you are asking originally sounds like the need for an ugly workaround. Avoid this.


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: How to avoid validation trigger in Xtext [message #1693931 is a reply to message #1693874] Wed, 29 April 2015 11:04 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Validation is run in the background and cancelled when the user
continues to type (since 2.8). Where do you see blocked UI?

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Find help at http://xtext.itemis.com or xtext(@)itemis.com
Blog: zarnekow.blogspot.com
Twitter: @szarnekow
Google+: https://www.google.com/+SebastianZarnekow
Previous Topic:How to Disable outline view and show only Quickoutline view
Next Topic:Reusing XAnnotation
Goto Forum:
  


Current Time: Thu Apr 18 01:55:40 GMT 2024

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

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

Back to the top