use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperation_implicitArgumentOnExtension_shadows_implicitArgumentOnStaticExtension.
@Test
public void testOperation_implicitArgumentOnExtension_shadows_implicitArgumentOnStaticExtension() throws Exception {
XtendClass clazz = clazz("import static extension testdata.LinkingStaticTypeEquallyNamed.*" + "class SomeClass {\n" + " def void method(Object it) {\n" + " withArgument\n" + " }\n" + " extension testdata.LinkingType\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("testdata.LinkingType.withArgument(java.lang.Object)", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testLocalVariable_shadows_field.
@Test
public void testLocalVariable_shadows_field() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def method() {\n" + " val String aString = null\n" + " aString\n" + " }\n" + " String aString" + "}");
XAbstractFeatureCall featureCall = getFeatureCall(clazz, 1);
assertLinksTo("aString", XbasePackage.Literals.XVARIABLE_DECLARATION, featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperation_sugarOnThis_shadows_sugarOnExtension.
@Test
public void testOperation_sugarOnThis_shadows_sugarOnExtension() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def method() {\n" + " fieldOverloadsMethod\n" + " }\n" + " def fieldOverloadsMethod() {}" + " extension testdata.LinkingType" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.fieldOverloadsMethod()", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testParameter_noConflict.
@Test
public void testParameter_noConflict() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def method(String aString) {\n" + " aString\n" + " }\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("aString", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingTest method testParameterizedExtension_07.
@Test
public void testParameterizedExtension_07() throws Exception {
XtendFile file = file("package testPackage\n" + "import org.eclipse.xtext.testing.util.ParseHelper\n" + "import org.eclipse.xtend.core.xtend.XtendFile\n" + "class C<T extends XtendFile> {\n" + " extension ParseHelper<? extends T>\n" + " def m() {" + " parse('').xtendTypes\n" + " }\n" + "}\n");
XtendClass c = (XtendClass) file.getXtendTypes().get(0);
XAbstractFeatureCall substring = findSingleFeatureCall(c);
assertEquals("org.eclipse.xtend.core.xtend.XtendFile.getXtendTypes()", substring.getFeature().getIdentifier());
}
Aggregations