Xtext versions, sortBy and XBlockExpression [message #841480] |
Wed, 11 April 2012 11:17 |
Alex Mising name Messages: 149 Registered: March 2010 |
Senior Member |
|
|
Hello,
A boring question about the five-step-tutorial.
I am using Eclipse Indigo where I've installed Xtext 2.1.1.v201111141332 from the update site for releases.
Upon finishing the tutorial, when I launch the runtime Eclipse to test it I see that my editor does not seem to recognize the XBlockExpression propertly. Specifically, the following declaration in the editor does not support the expression:
op getFullName() : String {
return firstName + " " + name;
}
The above generates the error "Couldn't resolve reference to JvmIdentifiableElement '+'." in the problems view. If I simply do a "return firstName" instead of using the string concatenation expression, the error goes away. The body in the tutorial is defined as follows:
Operation:
'op' name=ValidID
'('(params+=FullJvmFormalParameter
(',' params+=FullJvmFormalParameter)*)?')'
':' type=JvmTypeReference
body=XBlockExpression;
So why does XBlockExpression not accept this? I had some problems with the tutorial due to using the wrong version of Xtext, but I think v2.1.1 which I am now using is what that tutorial targets.
[Updated on: Wed, 11 April 2012 11:21] Report message to a moderator
|
|
|
|
Re: Xtext versions, sortBy and XBlockExpression [message #841513 is a reply to message #841491] |
Wed, 11 April 2012 12:13 |
Alex Mising name Messages: 149 Registered: March 2010 |
Senior Member |
|
|
Hi,
By default, my tutorial project depends on "org.eclipse.xtext.xbase". The plug-in dependencies view tells me that "org.eclipse.xtext.xbase" depends on "org.eclipse.xtext.xbase.lib". So I believe that this is transitively brought into play. In any case, I copy-pasted the dependency into the MANIFEST.MF so my required bundles now look like this (last line added by me):
Require-Bundle: org.eclipse.xtext;bundle-version="2.1.1";visibility:=reexport,
org.eclipse.xtext.xbase;bundle-version="2.1.1";resolution:=optional;visibility:=reexport,
org.apache.log4j;bundle-version="1.2.15";visibility:=reexport,
org.apache.commons.logging;bundle-version="1.0.4";resolution:=optional;visibility:=reexport,
org.eclipse.xtext.generator;resolution:=optional,
org.eclipse.emf.codegen.ecore;resolution:=optional,
org.eclipse.emf.mwe.utils;resolution:=optional,
org.eclipse.emf.mwe2.launch;resolution:=optional,
org.eclipse.xtext.util,
org.eclipse.emf.ecore,
org.eclipse.emf.common,
org.antlr.runtime,
org.eclipse.xtext.common.types,
org.eclipse.xtext.xtend2.lib,
org.eclipse.xtext.xbase.lib;bundle-version="2.1.1"
I restarted the runtime Eclipse workbench and forced a rebuild by editing the dmodel file and also doing a Project->Clean. Still the situation persists (see image).
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02877 seconds