Xpand/Xtend editor errors [message #717164] |
Fri, 19 August 2011 13:40 |
Bruce L. Messages: 81 Registered: June 2011 |
Member |
|
|
Hi,
I know this has been discussed already (e.g. http://www.eclipse.org/forums/index.php/m/662163/?srch=xpand+editor+property#msg_662163), but sorry, I cannot really figure out the solution.
Here is a simple grammar
grammar dsl.Crapdsl with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate crapdsl "dsl.Crapdsl"
Point:
name = ID
coordinate = Coordinate
;
Coordinate:
x = FLOAT
y = ID
z = ID
;
terminal FLOAT returns ecore::EFloat : ('+'?|'-')('0'..'9')*'.'('0'..'9')+;
Why does the Xpand/Xtend editor underline with red 'coordinate.x', complaining that it cannot find such property? y and z are fine, I assume because their type is not EFLoat.
The code generation works perfectly, so it is really an issue with the editor.
In the preferences, I have already selected 'JavaBeans metamodel' and 'EMF metamodel', with no success.
I am using Eclipse Helios, Xtext 1.0.2
Thank you
B
|
|
|
|
Re: Xpand/Xtend editor errors [message #717169 is a reply to message #717164] |
Fri, 19 August 2011 14:02 |
|
Hi,
i cannot reproduce this using Xtext 1.0.2 / Xpand 1.0.1 using emf metamodel nor using Xtext 2.0.0 / Xpand 1.1.0
using Java Beans Metamodel i can reproduce it in both versions.
can you please file a bug against the editor?
does it work with both metamodels configured in the workflow? if not file a bug for this too
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
Re: Xpand/Xtend editor errors [message #718079 is a reply to message #717252] |
Tue, 23 August 2011 07:50 |
Bruce L. Messages: 81 Registered: June 2011 |
Member |
|
|
I see. Thanks for the explanation.
Unfortunately the problem persists, even if I avoid completely custom terminal rules:
Coordinate:
x = Float
y = ID
z = ID
;
Float returns ecore::EFloat :
('+'?|'-')(Digit)*'.'(Digit)+;
Digit:
('0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9');
(I also had to provide a custom ValueConverter to transform a string like -13.093 to a Float)
I'm sure this is not the best neither most elegant way to do what I want; anyway, even though there are no terminal rules, the xpand editor still complains about the property coordinate.x. Looks like the problem is with ecore types.
B
[Updated on: Tue, 23 August 2011 08:52] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04149 seconds