use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testField_local_shadowsInvisibleOnIt.
@Test
public void testField_local_shadowsInvisibleOnIt() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def method(testdata.LinkingType it) {\n" + " protectedField\n" + " }\n" + " String protectedField\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.protectedField", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testField_inherited_shadows_sugarOnIt.
@Test
public void testField_inherited_shadows_sugarOnIt() throws Exception {
XtendClass clazz = clazz("class SomeClass extends testdata.LinkingTypeEquallyNamed {\n" + " def method(testdata.LinkingTypeEquallyNamed it) {\n" + " fieldOverloadsMethod\n" + " }\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("testdata.LinkingTypeEquallyNamed.fieldOverloadsMethod", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method getFeatureCall.
protected XAbstractFeatureCall getFeatureCall(XtendClass clazz, int expressionInFunction) {
XtendFunction function = (XtendFunction) clazz.getMembers().get(0);
XBlockExpression body = (XBlockExpression) function.getExpression();
XAbstractFeatureCall result = (XAbstractFeatureCall) body.getExpressions().get(expressionInFunction);
return result;
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperationWithParam_overloaded.
@Test
public void testOperationWithParam_overloaded() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def void method() {\n" + " methodWithParam('foo')\n" + " }\n" + " def methodWithParam(String s) {}\n" + " def methodWithParam(StringBuffer s) {}\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.methodWithParam(java.lang.String)", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testField_local_shadows_sugarOnIt.
@Test
public void testField_local_shadows_sugarOnIt() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def method(testdata.LinkingType it) {\n" + " fieldOverloadsMethod\n" + " }\n" + " String fieldOverloadsMethod\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.fieldOverloadsMethod", featureCall);
}
Aggregations