Skip to main content


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: 1193
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: Thu Apr 25 10:22:46 GMT 2024

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

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

Back to the top