Community
Participate
Working Groups
To implement the browser-line navigation feature (press Ctrl and hover over a declaration - in HEAD), I need the SelectionEngine.checkSelection() functionality. My workaround so far was to use the code from double click strategy to highlight the text corresponding to the declaration. I was wondering if there were plans to make this class and method API.
Not currently.
Could be promoted to CharOperation... David, what do you think ?
checkSelection() can not be easily promoted to CharOperation because this method change the value of several fields of SelectionEngine. - int actualSelectionStart - int actualSelectionEnd - char[] selectedIdentifier - char[] qualifiedSelection
Claude, you can easily create your own method. Use 'org.eclipse.jdt.core.ToolFactory#createScanner()' and copy the algorithm of 'SelectionEngine#checkSelection()' (replace 'Scanner' by 'IScanner' and 'scanner.startPosition' by 'scanner.getCurrentTokenStartPosition()' and 'scanner.currentPosition' by 'scanner.getCurrentTokenEndPosition() + 1').
Well, I rather stick to the double click strategy for now. I don't feel like duplicating that much code.
checkSelection can not be promoted to API. Closing.