Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Performing automatic corrections
Performing automatic corrections [message #1059692] Tue, 21 May 2013 08:58 Go to next message
Marco Naddeo is currently offline Marco NaddeoFriend
Messages: 62
Registered: November 2012
Member
Hi Smile

The Java editor automatically corrects the code in some cases... For example, if I have a class B which extends a class A, I can declare an object myObject in this way:

A myObject = new B();


but now, supposing that myMethod is a method definied in the subclass B, if I try to call it directly on myObject (declared of type A):

myObject.myMethod()


the editor in some cases automatically adds a cast converting the code as following:

((B)myObject).myMethod()


Now, I have to implement some automatic corrections on user typing. Is there some Xtext or Eclipse support for implementing them?

Where can I hook to do this?


Thanks in advance,
Marco
Re: Performing automatic corrections [message #1064663 is a reply to message #1059692] Thu, 20 June 2013 13:07 Go to previous messageGo to next message
Marco Naddeo is currently offline Marco NaddeoFriend
Messages: 62
Registered: November 2012
Member
No ideas or hints? Rolling Eyes
Re: Performing automatic corrections [message #1064667 is a reply to message #1059692] Thu, 20 June 2013 13:15 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1159
Registered: July 2009
Senior Member
Hi,

validation+quickfix ("simple"), auto edit strategy (complicated for this use case).

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Previous Topic:Scope for EObject with Qualified Name
Next Topic:Xtext Grammar - Exclusion of a specific Rule
Goto Forum:
  


Current Time: Fri Nov 28 18:31:49 GMT 2014

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

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