How do I pass the current Eclipse text editor cursor location to an external tool?

734 Views Asked by At

The company I work at is adopting Eclipse for work on our proprietary languages. I'm writing an external tool to replace functionality that we had in our proprietary editor, allowing programmers to select an item from our software to be inserted at the cursor's current location.

I've reviewed the external tool documentation and there are no variables that appear to return the current cursor location:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fconcepts-exttools.htm

I found slightly similar questions that showed Java methods: Eclipse-plugin how to get current text editor corsor position

Unfortunately, I do not know Java, and even if I knew Java, I don't know if Java methods can be accessed from the external tools argument. Are there undocumented, or non-standard, external tool variables I could use?

In TextPad I would have used $Line and $Col to determine the current cursor location in a tool argument. What do I do in Eclipse?

1

There are 1 best solutions below

3
On BEST ANSWER

the discussion here seems to offer a solution to get you the current line.