use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperationWithTwoParams_overloaded_itPresent.
@Test
public void testOperationWithTwoParams_overloaded_itPresent() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def void method(Object it) {\n" + " methodWithParam('foo', 'bar')\n" + " }\n" + " def methodWithParam(String s1, String s2) {}\n" + " def methodWithParam(StringBuffer s1, String s2) {}\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("SomeClass.methodWithParam(java.lang.String,java.lang.String)", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testLocalVariable_noConflict.
@Test
public void testLocalVariable_noConflict() throws Exception {
XtendClass clazz = clazz("class SomeClass {\n" + " def method() {\n" + " val String aString = null\n" + " aString\n" + " }\n" + "}");
XAbstractFeatureCall featureCall = getFeatureCall(clazz, 1);
assertLinksTo("aString", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperation_sugarImplicitArgumentOnExtension_shadows_sugarOnStaticExtension.
@Test
public void testOperation_sugarImplicitArgumentOnExtension_shadows_sugarOnStaticExtension() throws Exception {
XtendClass clazz = clazz("import static extension testdata.LinkingStaticTypeEquallyNamed.*" + "class SomeClass {\n" + " def void method(Object it) {\n" + " withArgument2\n" + " }" + " extension testdata.LinkingType\n" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("testdata.LinkingType.getWithArgument2(java.lang.Object)", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testField_noConflicts_publicStaticImport.
@Test
public void testField_noConflicts_publicStaticImport() throws Exception {
XtendClass clazz = clazz("import static testdata.LinkingStaticType.*\n" + "class SomeClass {\n" + " def method() {\n" + " publicField\n" + " }" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("testdata.LinkingStaticType.publicField", featureCall);
}
use of org.eclipse.xtext.xbase.XAbstractFeatureCall in project xtext-xtend by eclipse.
the class LinkingShadowingTest method testOperation_sugarOnStaticExtension.
@Test
public void testOperation_sugarOnStaticExtension() throws Exception {
XtendClass clazz = clazz("import static extension testdata.LinkingStaticTypeEquallyNamed.*" + "class SomeClass {\n" + " def void method(Object it) {\n" + " withArgument2\n" + " }" + "}");
XAbstractFeatureCall featureCall = getFirstFeatureCall(clazz);
assertLinksTo("testdata.LinkingStaticTypeEquallyNamed.getWithArgument2(java.lang.Object)", featureCall);
}
Aggregations