use of org.eclipse.xtext.xbase.XAssignment in project xtext-xtend by eclipse.
the class AssignmentLinkingTest method getAssignment.
protected XAssignment getAssignment(XtendClass clazz, int assignmentInFunction) {
XtendFunction function = (XtendFunction) clazz.getMembers().get(0);
XBlockExpression body = (XBlockExpression) function.getExpression();
List<XExpression> expressions = body.getExpressions();
int idx = assignmentInFunction;
if (idx == -1)
idx = expressions.size() - 1;
XAssignment result = (XAssignment) expressions.get(idx);
return result;
}
use of org.eclipse.xtext.xbase.XAssignment in project xtext-xtend by eclipse.
the class AssignmentLinkingTest method testUnqualifiedField_onIt.
@Test
public void testUnqualifiedField_onIt() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def void method(testdata.FieldAccess it) {\n" + " stringField = 'foo'\n" + " }" + "}");
XAssignment assignment = getLastAssignment(clazz);
assertLinksTo("testdata.FieldAccess.stringField", assignment);
assertImplicitReceiver("it", assignment);
}
Aggregations