Hi,
here is a grammar that use JvmDeclaredType
grammar altair.lang.xtext.example.jvmtypes.JvmTypes with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes
generate jvmTypes "http://www.lang.altair/xtext/example/jvmtypes/JvmTypes"
Model:
greetings+=Greeting*;
Greeting:
'Hello' name=ID '!' javaDeclaredType=JavaDeclaredType;
FQN:
ID ('.' ID)*;
JavaDeclaredType:
javaDeclaredType=[jvmTypes::JvmDeclaredType|FQN];
here is an example of grammar usage:
Hello jvmType! test.MyJvmType
Hello jvmType! MyJvmType
I have a java project with xtext nature, in it I have 2 files:
(1) a java class a named MyJvmType and (2) a dls file with the content above.
I get "Couldn't resolve reference to JvmDeclaredType" for both lines
NOTE:
This is a reduced example
the bigger problem I'm trying to solve involves types that come from other projects. all of this this used (a few weeks ago) to work. off course in the case of other projects I added the projects to the build path.
help please
edit:
I followed the tutorial from Lorenzo Bettini
http://java.dzone.com/articles/using-jvm-types-xtext-21-and
before xtext 2.8.0 it worked and I think now it doesn't
edit2:
working on 2.7.2.v201409160908
not working on 2.8.0.v201503090534
I opened a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=465091
edit3:
this issue is resolved in 2.8.1 ad on
I personally checked it on 2.8.2 and Holger Schill said he checked it on 2.8.1
[Updated on: Tue, 21 April 2015 09:39] by Moderator