Customizing Syntax Highlighting [message #1006210] |
Wed, 30 January 2013 08:24  |
Eclipse User |
|
|
|
Hi,
I've tried out to customize my Syntax Highlighting and have got two questions.
1. I've have implemented the necessary classes for customizing the Syntax Highlighting for one element of my grammar (which works so far). But then, the standrad Syntax Highlighting i.e. key word highlightig doesn't work anymore. Is this normal behaviuour?
2. In my grammar, one element consist of a Boolean flag. Depending on true or false, I want to change the Syntax Highlighting for this element. But I don't know how to access the Boolean attribute out of the ISemanticHighlightingCalculator. I used INodes so far:
public void provideHighlightingFor(XtextResource resource,
IHighlightedPositionAcceptor acceptor) {
if (resource == null || resource.getParseResult() == null)
return;
INode root = resource.getParseResult().getRootNode();
BidiTreeIterator<INode> iterator = root.getAsTreeIterable().iterator();
while (iterator.hasNext()) {
INode node = iterator.next();
if (node.getSemanticElement() instanceof ParameterDesc) {
// What I want to have:
// if (pdesc.isUnselected() == true) { do something }
}
}
}
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05807 seconds