protected void highlightSpecialIdentifiers( ILeafNode leafNode, IHighlightedPositionAcceptor acceptor, TerminalRule idRule) { ITextRegion leafRegion = leafNode.getTextRegion(); if (idLengthsToHighlight.get(leafRegion.getLength())) { EObject element = leafNode.getGrammarElement(); if (element == idRule || (element instanceof RuleCall && ((RuleCall) element).getRule() == idRule)) { String text = leafNode.getText(); String highlightingID = highlightedIdentifiers.get(text); if (highlightingID != null) { acceptor.addPosition(leafRegion.getOffset(), leafRegion.getLength(), highlightingID); } } } }
protected void highlightNumberLiterals( XNumberLiteral literal, IHighlightedPositionAcceptor acceptor) { ICompositeNode node = NodeModelUtils.findActualNodeFor(literal); ITextRegion textRegion = node.getTextRegion(); acceptor.addPosition(textRegion.getOffset(), textRegion.getLength(), NUMBER_ID); }