use of org.eclipse.lsp4j.FoldingRangeRequestParams in project xtext-core by eclipse.
the class AbstractLanguageServerTest method testFolding.
/**
* @since 2.26
*/
protected void testFolding(final Procedure1<? super FoldingConfiguration> configurator) {
try {
@Extension final FoldingConfiguration configuration = new FoldingConfiguration();
configuration.setFilePath(("MyModel." + this.fileExtension));
configurator.apply(configuration);
final FileInfo fileInfo = this.initializeContext(configuration);
FoldingRangeRequestParams _foldingRangeRequestParams = new FoldingRangeRequestParams();
final Procedure1<FoldingRangeRequestParams> _function = (FoldingRangeRequestParams it) -> {
String _uri = fileInfo.getUri();
TextDocumentIdentifier _textDocumentIdentifier = new TextDocumentIdentifier(_uri);
it.setTextDocument(_textDocumentIdentifier);
};
FoldingRangeRequestParams _doubleArrow = ObjectExtensions.<FoldingRangeRequestParams>operator_doubleArrow(_foldingRangeRequestParams, _function);
final List<FoldingRange> foldings = this.languageServer.foldingRange(_doubleArrow).get();
this.assertEqualsStricter(configuration.getExpectedFoldings(), this.toExpectation(foldings));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.lsp4j.FoldingRangeRequestParams in project eclipse.jdt.ls by eclipse.
the class FoldingRangeHandlerTest method getFoldingRanges.
private List<FoldingRange> getFoldingRanges(String className) throws CoreException {
String uri = ClassFileUtil.getURI(project, className);
TextDocumentIdentifier identifier = new TextDocumentIdentifier(uri);
FoldingRangeRequestParams params = new FoldingRangeRequestParams();
params.setTextDocument(identifier);
return new FoldingRangeHandler().foldingRange(params, monitor);
}
Aggregations