Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » customize error "Cannot use this in a static context"
customize error "Cannot use this in a static context" [message #1692649] Fri, 17 April 2015 07:57 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1775
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I'd like to customize the error message concerning 'this' (and 'super'):
in my DSL I don't want to support neither of them, since basically,
internally, everything is a "static context". So, I'm happy with usage
errors being detected, but I'd like to customize such error.

I see that error is generated in
org.eclipse.xtext.xbase.typesystem.internal.FeatureLinkingCandidate.validate(IAcceptor<?
super AbstractDiagnostic>) which I guess is not meant for customization
(there's no injection there).

Would it be better to perform customization at another level, such as
scoping? If so, which class is ideal for such customization?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: customize error &quot;Cannot use this in a static context&quot; [message #1692742 is a reply to message #1692649] Fri, 17 April 2015 13:45 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3109
Registered: July 2009
Senior Member
Hi Lorenzo,

we have plans to make it easier to customize xbase linking validation
but for now you may want to specialize the IDiagnosticConverter and
fixup the wording there.

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
Re: customize error &quot;Cannot use this in a static context&quot; [message #1692761 is a reply to message #1692742] Fri, 17 April 2015 16:07 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1775
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 17/04/2015 15:45, Sebastian Zarnekow wrote:
> Hi Lorenzo,
>
> we have plans to make it easier to customize xbase linking validation
> but for now you may want to specialize the IDiagnosticConverter and
> fixup the wording there.
>
> Best,
> Sebastian

Thank you Sebastian! Works like a charm :)

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:[SOLVED] Creating if-then expression on the fly in the JvmModelInferrer
Next Topic:[SOLVED] Instance a custom element inside the model factory
Goto Forum:
  


Current Time: Mon Apr 19 20:08:42 GMT 2021

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

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

Back to the top