use of org.eclipse.xtext.ide.editor.syntaxcoloring.ISemanticHighlightingCalculator in project xtext-eclipse by eclipse.
the class SemanticHighlightingTest method highlight.
protected void highlight(String grammar) {
try {
XtextResource resource = getResourceFromString(grammar);
ISemanticHighlightingCalculator calculator = get(ISemanticHighlightingCalculator.class);
calculator.provideHighlightingFor(resource, this, CancelIndicator.NullImpl);
assertTrue(expectedRegions.toString(), expectedRegions.isEmpty());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.eclipse.xtext.ide.editor.syntaxcoloring.ISemanticHighlightingCalculator in project xtext-eclipse by eclipse.
the class SemanticHighlightingTest method testNullPointerOnInvalidReturnKeyword.
@Test
public void testNullPointerOnInvalidReturnKeyword() throws Exception {
XtextResource resource = getResourceFromStringAndExpect("grammar test with org.eclipse.xtext.common.Terminals\n" + "import 'http://www.eclipse.org/emf/2002/Ecore'\n" + "terminal fragment FOO returns EString: 'a';", 1);
ISemanticHighlightingCalculator calculator = get(ISemanticHighlightingCalculator.class);
calculator.provideHighlightingFor(resource, new IHighlightedPositionAcceptor() {
@Override
public void addPosition(int offset, int length, String... id) {
// ignore
}
}, CancelIndicator.NullImpl);
}
Aggregations