Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Overriding default validator of one particular reference object(References either show to callable steps within DSL or external definition, no validation error should popup)
Overriding default validator of one particular reference object [message #1800835] Tue, 08 January 2019 21:20 Go to next message
Martin Moser is currently offline Martin MoserFriend
Messages: 18
Registered: January 2019
Junior Member
Hi all,

I have implemented a DSL to replace our test-cases which have been described in Excel so far.
My DSL also contains references to other elements like:

StepCall returns Expression:
{StepCall } 'call' calledstep=[StepName] '(' (arguments+=ParamValue (',' arguments+=ParamValue)*)? ')'
;

We have also a launch configuration which can deal with the new DSL and the old Excel stuff in order to run the tests.
Because of that I need a mixture for that call syntax in my DSL editor.
A call of StepCall can either point to an existing StepName from the DSL or to a string representing an Excel file.

With the rule above I get a validation error if there is no StepName defined inside my DSL language.

My question is, how can I override that default check for references to check for a StepName or an existing Excel file. I know how to implement additional checks but I want to replace the default checks in my case.

Is there a better way than overriding the validation?
Could I apply the rule to either be a call or a string?

Thanks in advance!

Best regards,
Martin
Re: Overriding default validator of one particular reference object [message #1800837 is a reply to message #1800835] Tue, 08 January 2019 21:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Which particular check do you mean? Could not resolve reference to?
That is done by ilinkingdiagnosticmessageprovider
Should work to return null there


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Overriding default validator of one particular reference object [message #1800838 is a reply to message #1800837] Tue, 08 January 2019 21:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
P.s. if your excel files are kinda formal you might consider to introduce a iresourceservice provider
And fake emf resource for xls so that you can actually reference into the excel file


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Overriding default validator of one particular reference object [message #1800863 is a reply to message #1800838] Wed, 09 January 2019 08:49 Go to previous message
Martin Moser is currently offline Martin MoserFriend
Messages: 18
Registered: January 2019
Junior Member
Hi Christian,

thank you very much for that fast replay.

Implementing a ILinkingDiagnosticMessageProvider worked like a charm.
The IResourceServiceProvider idea sounds interesting, I will try that later. At the moment the solution above does the job.

Best regards,
Martin
Previous Topic:What is the effect of disabling XtextSpellingReconcileStrategy and XtextDocumentReconcileStrategy on
Next Topic:Delay of Content Assist Autoactivation
Goto Forum:
  


Current Time: Thu Apr 25 09:18:07 GMT 2024

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

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

Back to the top