How to get a SemanticSyntaxHighlighter to run [message #1766347] |
Tue, 20 June 2017 08:26  |
Eclipse User |
|
|
|
I seem to be having some problems with the configuration mechanism for the IDE package. I have written a short Semantic Highlighting provider (which is just a stub):
package obuaop.ide.highlighting
import org.eclipse.xtext.ide.editor.syntaxcoloring.ISemanticHighlightingCalculator
import org.eclipse.xtext.resource.XtextResource
import org.eclipse.xtext.ide.editor.syntaxcoloring.IHighlightedPositionAcceptor
import org.eclipse.xtext.util.CancelIndicator
class CaopleSemanticHighlightingCalculator implements ISemanticHighlightingCalculator {
override provideHighlightingFor(XtextResource resource, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator) {
System.out.println("I am here")
throw new UnsupportedOperationException("TODO: auto-generated method stub")
}
}
I then tried to write a bindISemanticHighlightingCalculator method in the CaopleIdeModule provided class, but this turned out to be impossible because it is required to return a class which extends ISemanticHighlightingCalculator, not implements it. Since there is no AbstractSemanticHighlightingCalculator class generated it seems this can't be done, so instead I went with:
class CaopleIdeModule extends AbstractCaopleIdeModule {
def public configureSemanticHighlighting(Binder b) {
System.out.println("I am here")
b.bind(ISemanticHighlightingCalculator).to(CaopleSemanticHighlightingCalculator)
}
}
However, the "I am here" message is never printed so this never runs. I can't see why it wouldn't be being picked up by GetBindings in AbstractGenericModule, and there is no configuration error. What other reason would there be for this any reason why this is not running and binding? I wondered if it was because XTend is forcing a final modifier onto the Binder type in the parameter?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03531 seconds