public class XbaseHighlightingCalculator extends DefaultSemanticHighlightingCalculator implements XbaseHighlightingStyles
A base implementation of the semantic highlighting calculation.
Highlights references to Primitives
, e.g. void, int, boolean
and the identifier
this
.
Modifier and Type | Field and Description |
---|---|
protected AnnotationLookup |
annotationLookup |
protected OperationCanceledManager |
operationCanceledManager |
ANNOTATION, DEPRECATED_MEMBERS, EXTENSION_METHOD_INVOCATION, FIELD, STATIC_FIELD, STATIC_METHOD_INVOCATION
COMMENT_ID, DEFAULT_ID, INVALID_TOKEN_ID, KEYWORD_ID, NUMBER_ID, PUNCTUATION_ID, STRING_ID, TASK_ID
Constructor and Description |
---|
XbaseHighlightingCalculator() |
Modifier and Type | Method and Description |
---|---|
protected void |
computeFeatureCallHighlighting(XAbstractFeatureCall featureCall,
IHighlightedPositionAcceptor acceptor) |
protected void |
computeReferencedJvmTypeHighlighting(IHighlightedPositionAcceptor acceptor,
org.eclipse.emf.ecore.EObject referencer,
CancelIndicator cancelIndicator) |
protected void |
doProvideHighlightingFor(XtextResource resource,
IHighlightedPositionAcceptor acceptor,
CancelIndicator cancelIndicator)
Actual implementation of the semantic highlighting calculation.
|
protected TerminalRule |
getIDRule() |
protected void |
highlightAnnotation(XAnnotation annotation,
IHighlightedPositionAcceptor acceptor) |
protected void |
highlightAnnotation(XAnnotation annotation,
IHighlightedPositionAcceptor acceptor,
java.lang.String highlightingConfiguration) |
protected void |
highlightDeprecation(IHighlightedPositionAcceptor acceptor,
org.eclipse.emf.ecore.EObject referencer,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EObject resolvedReferencedObject) |
protected boolean |
highlightElement(org.eclipse.emf.ecore.EObject object,
IHighlightedPositionAcceptor acceptor,
CancelIndicator cancelIndicator) |
protected void |
highlightFeatureCall(XAbstractFeatureCall featureCall,
IHighlightedPositionAcceptor acceptor,
java.lang.String id) |
protected void |
highlightNumberLiterals(XNumberLiteral literal,
IHighlightedPositionAcceptor acceptor) |
protected void |
highlightReferenceJvmType(IHighlightedPositionAcceptor acceptor,
org.eclipse.emf.ecore.EObject referencer,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EObject resolvedReferencedObject) |
protected void |
highlightReferenceJvmType(IHighlightedPositionAcceptor acceptor,
org.eclipse.emf.ecore.EObject referencer,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EObject resolvedReferencedObject,
java.lang.String highlightingConfiguration) |
protected void |
highlightSpecialIdentifiers(IHighlightedPositionAcceptor acceptor,
ICompositeNode root) |
protected void |
highlightSpecialIdentifiers(ILeafNode leafNode,
IHighlightedPositionAcceptor acceptor,
TerminalRule idRule) |
protected java.util.Map<java.lang.String,java.lang.String> |
initializeHighlightedIdentifiers()
Returns a mapping from identifier (e.g.
|
protected boolean |
isExtension(JvmIdentifiableElement jvmIdentifiableElement) |
void |
provideHighlightingFor(XtextResource resource,
IHighlightedPositionAcceptor acceptor,
CancelIndicator cancelIndicator) |
highlightElementRecursively, highlightFeature, highlightNode, highlightTasks, searchAndHighlightElements
@Inject protected AnnotationLookup annotationLookup
@Inject protected OperationCanceledManager operationCanceledManager
public void provideHighlightingFor(XtextResource resource, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator)
provideHighlightingFor
in interface ISemanticHighlightingCalculator
provideHighlightingFor
in class DefaultSemanticHighlightingCalculator
resource
- the resource that will be highlighted. May be null
in some rare cases.acceptor
- used to announce the mapping from text-range to the style's id. The acceptor will never be null
.cancelIndicator
- used to determine whether we should stop searching for highlighting positions
(use OperationCanceledManager
to check)protected void doProvideHighlightingFor(XtextResource resource, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator)
DefaultSemanticHighlightingCalculator
Actual implementation of the semantic highlighting calculation. It is ensured, that the given resource is not
null
and refers to an initialized parse result.
By default this will visit the elements in the resource recursively and call
DefaultSemanticHighlightingCalculator.highlightElement(EObject, IHighlightedPositionAcceptor, CancelIndicator)
for each of them. As the
last step, tasks will be highlighted.
Clients can override this method if the default recursive approach does not fit their use case
doProvideHighlightingFor
in class DefaultSemanticHighlightingCalculator
resource
- a valid to-be-processed resource. Is never null
.acceptor
- the acceptor. Is never null
.protected boolean highlightElement(org.eclipse.emf.ecore.EObject object, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator)
highlightElement
in class DefaultSemanticHighlightingCalculator
protected void computeReferencedJvmTypeHighlighting(IHighlightedPositionAcceptor acceptor, org.eclipse.emf.ecore.EObject referencer, CancelIndicator cancelIndicator)
protected void highlightReferenceJvmType(IHighlightedPositionAcceptor acceptor, org.eclipse.emf.ecore.EObject referencer, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject resolvedReferencedObject)
protected void highlightReferenceJvmType(IHighlightedPositionAcceptor acceptor, org.eclipse.emf.ecore.EObject referencer, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject resolvedReferencedObject, java.lang.String highlightingConfiguration)
protected void highlightDeprecation(IHighlightedPositionAcceptor acceptor, org.eclipse.emf.ecore.EObject referencer, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject resolvedReferencedObject)
protected void computeFeatureCallHighlighting(XAbstractFeatureCall featureCall, IHighlightedPositionAcceptor acceptor)
protected boolean isExtension(JvmIdentifiableElement jvmIdentifiableElement)
protected void highlightFeatureCall(XAbstractFeatureCall featureCall, IHighlightedPositionAcceptor acceptor, java.lang.String id)
protected void highlightAnnotation(XAnnotation annotation, IHighlightedPositionAcceptor acceptor)
protected void highlightAnnotation(XAnnotation annotation, IHighlightedPositionAcceptor acceptor, java.lang.String highlightingConfiguration)
protected void highlightNumberLiterals(XNumberLiteral literal, IHighlightedPositionAcceptor acceptor)
protected void highlightSpecialIdentifiers(IHighlightedPositionAcceptor acceptor, ICompositeNode root)
protected TerminalRule getIDRule()
protected void highlightSpecialIdentifiers(ILeafNode leafNode, IHighlightedPositionAcceptor acceptor, TerminalRule idRule)
protected java.util.Map<java.lang.String,java.lang.String> initializeHighlightedIdentifiers()
null
.