I’m looking for the right extension point for my plugin to access the cursor position in the editor. The aim is to provide additional information to the current code line in a plugin view.
I sure it is possible, since the Outline view for example highlights the current function which I’m within.
thx
I’m looking for the right extension point for my plugin to access the cursor
Share
You can use
textSelection.getOffset()from the pattern you’ve found and then use theorg.eclipse.jface.text.IDocumentinterface to extract text from the document to do whatever analysis you want.IDocumenthas methods to convert back and forth between character offsets and lines.