use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class FormattingTest method testRangeFormattingService.
@Test
public void testRangeFormattingService() {
final Procedure1<RangeFormattingConfiguration> _function = (RangeFormattingConfiguration it) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("type Foo{int bar} type Bar{Foo foo}");
it.setModel(_builder.toString());
Range _range = new Range();
final Procedure1<Range> _function_1 = (Range it_1) -> {
Position _position = new Position(0, 0);
it_1.setStart(_position);
Position _position_1 = new Position(0, 17);
it_1.setEnd(_position_1);
};
Range _doubleArrow = ObjectExtensions.<Range>operator_doubleArrow(_range, _function_1);
it.setRange(_doubleArrow);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("type Foo{");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("int bar");
_builder_1.newLine();
_builder_1.append("} type Bar{Foo foo}");
it.setExpectedText(_builder_1.toString());
};
this.testRangeFormatting(_function);
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class FormattingTest method testRangeFormattingService_02.
@Test
public void testRangeFormattingService_02() {
final Procedure1<DocumentRangeFormattingParams> _function = (DocumentRangeFormattingParams it) -> {
FormattingOptions _formattingOptions = new FormattingOptions(4, true);
it.setOptions(_formattingOptions);
};
final Procedure1<RangeFormattingConfiguration> _function_1 = (RangeFormattingConfiguration it) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("type Foo{int bar} type Bar{Foo foo}");
it.setModel(_builder.toString());
Range _range = new Range();
final Procedure1<Range> _function_2 = (Range it_1) -> {
Position _position = new Position(0, 0);
it_1.setStart(_position);
Position _position_1 = new Position(0, 17);
it_1.setEnd(_position_1);
};
Range _doubleArrow = ObjectExtensions.<Range>operator_doubleArrow(_range, _function_2);
it.setRange(_doubleArrow);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("type Foo{");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("int bar");
_builder_1.newLine();
_builder_1.append("} type Bar{Foo foo}");
it.setExpectedText(_builder_1.toString());
};
this.testRangeFormatting(_function, _function_1);
}
Aggregations