I would like to get the output of some command line argument (which I’m working) on in a format which Eclipse understands.
For example there should be link to files and line numbers and Eclipse should make it possible to jump to that file.
We can’t really be too bothered to create a real Eclipse extension, is there a lightweight way to achieve this?
I would imagine that even an HTML/Xml in some format might work but I can’t find out something clear in the doc.
EDIT
After some more attempts I understood the following, with a Java simple program this actually works:
public class Prova {
public static void main(String[] args) {
System.out.println("message (/home/andrea/workspace/simple/src/Prova.java:2)");
}
}
Producing exactly the same output with a Python script instead doesn’t work:
import sys
if __name__ == '__main__':
print "message (/home/andrea/workspace/simple/src/Prova.java:2)"
And it doesn’t become an actual link..
So I guess this thing isn’t a global Eclipse feature, but only works under certain conditions, which I would really like to know what they are..
Currently the only pattern detected by PyDev is something as:
print r’File “c:\path\to\file.py”, line 1′
This is implemented in PyDev at: org.python.pydev.debug.ui.PythonConsoleLineTracker (github: https://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev.debug/src/org/python/pydev/debug/ui/PythonConsoleLineTracker.java — you can see the pattern used there)
Note that the link will only be created if it’s able to find the file.
Patches are welcome if you want some other format to be matched (or to make that more customizable).