use of org.eclipse.xtext.testing.DocumentHighlightConfiguration in project xtext-core by eclipse.
the class DocumentHighlightTest method singleLineNoOccurrences_SelectionBeforeWriteSiteMethodName.
@Test
public void singleLineNoOccurrences_SelectionBeforeWriteSiteMethodName() {
final Procedure1<DocumentHighlightConfiguration> _function = (DocumentHighlightConfiguration it) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("type A { op foo() { } }");
it.setModel(_builder.toString());
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("type A { op");
it.setColumn(_builder_1.length());
it.setExpectedDocumentHighlight("");
};
this.testDocumentHighlight(_function);
}
use of org.eclipse.xtext.testing.DocumentHighlightConfiguration in project xtext-core by eclipse.
the class DocumentHighlightTest method multipleLinesMultipleOccurrences_WithWhitespaces.
@Test
public void multipleLinesMultipleOccurrences_WithWhitespaces() {
final Procedure1<DocumentHighlightConfiguration> _function = (DocumentHighlightConfiguration it) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("type A {");
_builder.newLine();
_builder.append(" ");
_builder.append("op foo() { }");
_builder.newLine();
_builder.append(" ");
_builder.append("op bar() {");
_builder.newLine();
_builder.append(" ");
_builder.append("foo(10)");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
it.setModel(_builder.toString());
it.setLine(1);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append(" ");
_builder_1.append("op fo");
it.setColumn(_builder_1.length());
it.setExpectedDocumentHighlight("W [[1, 7] .. [1, 10]] | R [[3, 8] .. [3, 11]]");
};
this.testDocumentHighlight(_function);
}
use of org.eclipse.xtext.testing.DocumentHighlightConfiguration in project xtext-core by eclipse.
the class DocumentHighlightTest method singleLineMultipleOccurrences_SelectionOnWriteSite.
@Test
public void singleLineMultipleOccurrences_SelectionOnWriteSite() {
final Procedure1<DocumentHighlightConfiguration> _function = (DocumentHighlightConfiguration it) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("type A { op foo() { } op bar() { foo(10) } }");
it.setModel(_builder.toString());
it.setLine(0);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("type A { op fo");
it.setColumn(_builder_1.length());
it.setExpectedDocumentHighlight("W [[0, 12] .. [0, 15]] | R [[0, 33] .. [0, 36]]");
};
this.testDocumentHighlight(_function);
}
use of org.eclipse.xtext.testing.DocumentHighlightConfiguration in project xtext-core by eclipse.
the class DocumentHighlightTest method multipleLinesMultipleOccurrences_WithHorizontalTabs.
@Test
public void multipleLinesMultipleOccurrences_WithHorizontalTabs() {
final Procedure1<DocumentHighlightConfiguration> _function = (DocumentHighlightConfiguration it) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("type A {");
_builder.newLine();
_builder.append("\t");
_builder.append("op foo() { }");
_builder.newLine();
_builder.append("\t");
_builder.append("op bar() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("foo(10)");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
it.setModel(_builder.toString());
it.setLine(1);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("\t");
_builder_1.append("op fo");
it.setColumn(_builder_1.length());
it.setExpectedDocumentHighlight("W [[1, 4] .. [1, 7]] | R [[3, 2] .. [3, 5]]");
};
this.testDocumentHighlight(_function);
}
use of org.eclipse.xtext.testing.DocumentHighlightConfiguration in project xtext-core by eclipse.
the class DocumentHighlightTest method singleLineSingleOccurrenceWithMultipleTypes.
@Test
public void singleLineSingleOccurrenceWithMultipleTypes() {
final Procedure1<DocumentHighlightConfiguration> _function = (DocumentHighlightConfiguration it) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("type A { op foo() { } } type B { op foo() { } }");
it.setModel(_builder.toString());
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("type A { op fo");
it.setColumn(_builder_1.length());
it.setExpectedDocumentHighlight("W [[0, 12] .. [0, 15]]");
};
this.testDocumentHighlight(_function);
}
Aggregations