Skip to main content



      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 16:20 Go to next message
Eclipse UserFriend
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 16:22 Go to previous messageGo to next message
Eclipse UserFriend
Which particular check do you mean? Could not resolve reference to?
That is done by ilinkingdiagnosticmessageprovider
Should work to return null there
Re: Overriding default validator of one particular reference object [message #1800838 is a reply to message #1800837] Tue, 08 January 2019 16:23 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Overriding default validator of one particular reference object [message #1800863 is a reply to message #1800838] Wed, 09 January 2019 03:49 Go to previous message
Eclipse UserFriend
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: Sun Jun 15 11:31:26 EDT 2025

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

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

Back to the top