Skip to main content



      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 03:57 Go to next message
Eclipse UserFriend
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 09:45 Go to previous messageGo to next message
Eclipse UserFriend
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 12:07 Go to previous message
Eclipse UserFriend
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: Sun Jul 27 02:25:07 EDT 2025

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

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

Back to the top