Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to disable validation when editing in xtext editor?(validator performance)
How to disable validation when editing in xtext editor? [message #1840349] Tue, 13 April 2021 01:01 Go to next message
David Sun is currently offline David SunFriend
Messages: 14
Registered: July 2020
Junior Member
I have implemented a dsl editor based on xtext.

when the code of my dsl are more than 300 lines, the user experience of my xtext editor is getting slower and slower.

The xtext editor was blocked for serveral seconds when the validator was running.

How to disable validation when editing ? And How to enable validation after saving ?

Thanks!
Re: How to disable validation when editing in xtext editor? [message #1840350 is a reply to message #1840349] Tue, 13 April 2021 04:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13925
Registered: July 2009
Senior Member
Hi,

first you should profile where the time is spent and if validation is the problem at all.
second you should have a look at your check methods
and mark them with @Check(Check.NORMAL) instead of the default @Check which will be CheckType.FAST and be executed during editing. NORMAL will be executed on save


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to disable validation when editing in xtext editor? [message #1840351 is a reply to message #1840350] Tue, 13 April 2021 05:47 Go to previous messageGo to next message
David Sun is currently offline David SunFriend
Messages: 14
Registered: July 2020
Junior Member
Your advice works!
Thanks a lot!
Re: How to disable validation when editing in xtext editor? [message #1840383 is a reply to message #1840351] Tue, 13 April 2021 15:35 Go to previous message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 172
Registered: July 2009
Location: Canada
Senior Member
David,

Please read the section "Creating Custom Validation Rules" from the Xtext documentation - https://www.eclipse.org/Xtext/documentation/103_domainmodelnextsteps.html


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
Previous Topic:Qualified Name ID.ID....KEYWORD
Next Topic:Missing Rule BEGIN in White-space awareness grammar
Goto Forum:
  


Current Time: Thu May 06 01:56:40 GMT 2021

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

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

Back to the top