Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Migration of Xtext1.0 to Xtext2.3, Methods not found(Methods or alternatives not found)
Migration of Xtext1.0 to Xtext2.3, Methods not found [message #1006593] Fri, 01 February 2013 00:25 Go to next message
Ankit Agarwal is currently offline Ankit Agarwal
Messages: 28
Registered: March 2012
Junior Member
I followed the migration guide from http://www.eclipse.org/Xtext/documentation.html#migrating_from_1_0_x but i Could not find the alternative for the following methods in Xtext 2.3 which were present in Xtext1.0

1. NodeUtil.getNearestSemanticObject(AbstractNode node)
2. ParseTreeUtil.getLastCompleteNodeByOffset(CompositeNode node ,int offset);
3. NodeAdapter.getNodeAdapter(EObject obj);
4. NodeUtil.findASTElement(CompositeNode root);
5. NodeUtil.getRootNode(EObject obj);

Any Help will be much appreciated.

[Updated on: Fri, 01 February 2013 00:25]

Report message to a moderator

Re: Migration of Xtext1.0 to Xtext2.3, Methods not found [message #1006599 is a reply to message #1006593] Fri, 01 February 2013 01:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4406
Registered: July 2009
Senior Member
Hi in NodemodelUtils (findactualsemanticobjectfor) and inode
(getrootnode) may be some of the things you are looking for (have a
look at the java docs)

You will find replacements for everything. There is stuff that is
obsolete like getnodeadapter since the node model technically changed

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Migration of Xtext1.0 to Xtext2.3, Methods not found [message #1007027 is a reply to message #1006599] Mon, 04 February 2013 01:27 Go to previous messageGo to next message
Ankit Agarwal is currently offline Ankit Agarwal
Messages: 28
Registered: March 2012
Junior Member
Thanks Christian for your response.
I have one more doubt, There was a class in Xtext 1 as org.eclipse.xtext.MweReader which was deprecated, URIBasedReader is to be used as an alternative if i am not wrong, but i could not find an appropriate method equivalent to doValidate.
Re: Migration of Xtext1.0 to Xtext2.3, Methods not found [message #1007031 is a reply to message #1007027] Mon, 04 February 2013 02:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4406
Registered: July 2009
Senior Member
Hi as far as I remember the new class is simply called Reader

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Migration of Xtext1.0 to Xtext2.3, Methods not found [message #1007905 is a reply to message #1007031] Fri, 08 February 2013 01:02 Go to previous messageGo to next message
Ankit Agarwal is currently offline Ankit Agarwal
Messages: 28
Registered: March 2012
Junior Member
Hi,

I was successful in migrating all parts except the Editor Validations. As suggested i tried using error(String, EStructuralFeature) instead of error(String, Integer), but then i get the following error :
ERROR org.eclipse.xtext.validation.CompositeEValidator - Error executing EValidator
java.lang.IllegalArgumentException: The sources EClass 'ABC' does not expose the feature 'DEF'.

I am using it like
@Check(CheckType.FAST)
public void checkValue(final ABC abc) {
//some logiv....
error("Value does not match",Epackage.Literal.DEF);
}
Re: Migration of Xtext1.0 to Xtext2.3, Methods not found [message #1007973 is a reply to message #1007905] Fri, 08 February 2013 02:00 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4406
Registered: July 2009
Senior Member
Id expect something like my pack.literals.ABC__Name
Or pack.literals.ABC__somethingelse

Can you tell why you use DEF

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Previous Topic:Syntactic predicates in 0.8M4
Next Topic:beginner question
Goto Forum:
  


Current Time: Tue May 21 04:17:17 EDT 2013

Powered by FUDForum. Page generated in 0.01788 seconds