use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class RenameTest method testRenameOnDeclaration.
@Test
public void testRenameOnDeclaration() {
Position _position = new Position(0, 5);
this.doTest(this.firstFile, _position);
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class RenameTest method testRenameOnReference.
@Test
public void testRenameOnReference() {
Position _position = new Position(1, 5);
this.doTest(this.firstFile, _position);
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class RenameTest method testRenameOnReferenceInOtherFile.
@Test
public void testRenameOnReferenceInOtherFile() {
Position _position = new Position(1, 5);
this.doTest(this.secondFile, _position);
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class ColoringServiceImpl method getColoring.
@Override
public List<? extends ColoringInformation> getColoring(final XtextResource resource, final Document document) {
if ((resource == null)) {
return CollectionLiterals.<ColoringInformation>emptyList();
}
final ImmutableList.Builder<ColoringInformation> builder = ImmutableList.<ColoringInformation>builder();
final Procedure1<Object> _function = (Object it) -> {
List<INode> _xifexpression = null;
if ((it instanceof Property)) {
_xifexpression = NodeModelUtils.findNodesForFeature(((EObject) it), TestLanguagePackage.Literals.MEMBER__NAME);
} else {
List<INode> _xifexpression_1 = null;
if ((it instanceof Operation)) {
_xifexpression_1 = NodeModelUtils.findNodesForFeature(((EObject) it), TestLanguagePackage.Literals.MEMBER__NAME);
} else {
_xifexpression_1 = CollectionLiterals.<INode>emptyList();
}
_xifexpression = _xifexpression_1;
}
final List<INode> nodes = _xifexpression;
final Consumer<INode> _function_1 = (INode it_1) -> {
final int start = it_1.getOffset();
int _offset = it_1.getOffset();
int _length = it_1.getLength();
final int end = (_offset + _length);
Position _position = document.getPosition(start);
Position _position_1 = document.getPosition(end);
final Range range = new Range(_position, _position_1);
ColoringInformation _coloringInformation = new ColoringInformation(range, ColoringServiceImpl.STYLE_IDS);
builder.add(_coloringInformation);
};
nodes.forEach(_function_1);
};
IteratorExtensions.<Object>forEach(EcoreUtil.<Object>getAllContents(resource, true), _function);
return builder.build();
}
use of org.eclipse.lsp4j.Position in project xtext-core by eclipse.
the class DocumentHighlightComparatorTest method newRange.
private Range newRange(final int startLine, final int startChar, final int endLine, final int endChar) {
Position _position = new Position(startLine, startChar);
Position _position_1 = new Position(endLine, endChar);
return new Range(_position, _position_1);
}
Aggregations