Search in sources :

Example 1 with ITrace

use of org.eclipse.xtext.generator.trace.ITrace in project xtext-xtend by eclipse.

the class XtendTraceTests method testNoEmptyTraces.

@Test
public void testNoEmptyTraces() throws Exception {
    testHelper.createFile("test/Foo.java", "package test;\n" + "public class Foo {\n" + "	public void foo(Object it) {}\n" + "	public void _foo(Object it) {}\n" + "}");
    IFile sourceFile = testHelper.createFile("test/Zar", "package test\n" + "class Bar extends Foo {\n" + "	def dispatch foo(String it) {print(it)}\n" + "}");
    waitForBuild();
    ITrace trace = traceInformation.getTraceToTarget(sourceFile);
    assertNotNull(trace);
    trace.getBestAssociatedLocation(new TextRegion(65, 0));
}
Also used : IFile(org.eclipse.core.resources.IFile) TextRegion(org.eclipse.xtext.util.TextRegion) ITrace(org.eclipse.xtext.generator.trace.ITrace) Test(org.junit.Test)

Aggregations

IFile (org.eclipse.core.resources.IFile)1 ITrace (org.eclipse.xtext.generator.trace.ITrace)1 TextRegion (org.eclipse.xtext.util.TextRegion)1 Test (org.junit.Test)1