Going to a java source line in the Xtend editor

43 views
Skip to first unread message

christi...@nineconnections.com

unread,
Jun 27, 2017, 12:01:38 PM6/27/17
to Xtend Programming Language
When using stack traces outside of Eclipse, it is quite a hassle to first open the Xtend source file, then the Java source file, and then go to the java code line, then from there find the Xtend code line to edit. It also means having to have both the Xtend and Java code open and switching and interpreting a lot.

How about a bindable hotkey in the Xtend editor that lets you jump to a Java source code line? This would then find that line in the Xtend editor and jump the cursor there.

Christian Dietrich

unread,
Jun 27, 2017, 1:16:45 PM6/27/17
to Xtend Programming Language
you can do the following

(1) copy the stacktrace
(2) use the cmd+3 (on mac) or the quick access box in the top right
(3) type "open from clipboard" and select the corresponding entry

The Xtend file automatically should open at the correct posion

Christian Dietrich

unread,
Jun 27, 2017, 1:23:47 PM6/27/17
to Xtend Programming Language
alternatively:

- open console in eclipse
- click on the litte arrow and create/open a java stack trace console
- paste the stacktrace to the console
- click inside the stacktrace

Christian Dietrich

unread,
Jun 27, 2017, 1:33:37 PM6/27/17
to Xtend Programming Language
and:

in xtend you can call "open generated file" from context menu
in java you can call "open source file"

it should bring to the correct position both ways

christi...@nineconnections.com

unread,
Jun 28, 2017, 5:13:22 AM6/28/17
to Xtend Programming Language
Hi fellow Christian :-)

I am using the open generated / open source file already, and it is a great feature. However it still means working with two source files.

The reason I request this is because I am constantly having to do this. One of the weaknesses of Xtend compared to a natively compiled language is that stack traces are always referring to Java code lines. 

For example, I am now working on a gradle project with enhancements where I literally am debugging a nasty issue and I estimate I am jumping to Java line numbers in Xtend code literally hundreds of times yesterday. Being able to jump right to the xtend code line by entering a java line would save a lot!

However, that stack trace in the console copy trick also will help a bit, thank you.

christi...@nineconnections.com

unread,
Jun 28, 2017, 5:16:43 AM6/28/17
to Xtend Programming Language
The stack trace trick does not always work for me since it requires the stack traces to be nicely formatted. However I get errors like this:

nl.kii.async.fibers.test.TestFiberExtensions > testAwaitingErrors FAILED
    java.lang.Exception
        Caused by: co.paralleluniverse.fibers.VerifyInstrumentationException at TestFiberExtensions.java:212

Since it is not a standard formatted trace it does not seem to parse the link.

Christian Dietrich

unread,
Jun 28, 2017, 6:10:54 AM6/28/17
to Xtend Programming Language
well since all this is eclipse jdt api and not xtend api there is not much we can do about this.
Reply all
Reply to author
Forward
0 new messages