Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Customizing Syntax Highlighting
Customizing Syntax Highlighting [message #1006210] Wed, 30 January 2013 08:24 Go to previous message
Phil H is currently offline Phil H
Messages: 63
Registered: November 2012
Member
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 }
			}
		}
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:How to obtain starting offset in textual representation of a model element?
Next Topic:Creating RCP, no executable
Goto Forum:
  


Current Time: Sun May 19 16:29:05 EDT 2013

Powered by FUDForum. Page generated in 0.01579 seconds