use of org.eclipse.lsp4j.DocumentHighlightParams in project xtext-core by eclipse.
the class AbstractLanguageServerTest method testDocumentHighlight.
protected void testDocumentHighlight(final Procedure1<? super DocumentHighlightConfiguration> configurator) {
try {
DocumentHighlightConfiguration _documentHighlightConfiguration = new DocumentHighlightConfiguration();
final Procedure1<DocumentHighlightConfiguration> _function = (DocumentHighlightConfiguration it) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("MyModel.");
_builder.append(this.fileExtension);
it.setFilePath(_builder.toString());
};
@Extension final DocumentHighlightConfiguration configuration = ObjectExtensions.<DocumentHighlightConfiguration>operator_doubleArrow(_documentHighlightConfiguration, _function);
configurator.apply(configuration);
final String fileUri = this.initializeContext(configuration).getUri();
DocumentHighlightParams _documentHighlightParams = new DocumentHighlightParams();
final Procedure1<DocumentHighlightParams> _function_1 = (DocumentHighlightParams it) -> {
TextDocumentIdentifier _textDocumentIdentifier = new TextDocumentIdentifier(fileUri);
it.setTextDocument(_textDocumentIdentifier);
int _line = configuration.getLine();
int _column = configuration.getColumn();
Position _position = new Position(_line, _column);
it.setPosition(_position);
};
DocumentHighlightParams _doubleArrow = ObjectExtensions.<DocumentHighlightParams>operator_doubleArrow(_documentHighlightParams, _function_1);
final CompletableFuture<List<? extends DocumentHighlight>> highlights = this.languageServer.documentHighlight(_doubleArrow);
final Function1<DocumentHighlight, String> _function_2 = (DocumentHighlight it) -> {
return this.toExpectation(it);
};
final String actualDocumentHighlight = IterableExtensions.join(ListExtensions.map(highlights.get(), _function_2), " | ");
this.assertEquals(configuration.getExpectedDocumentHighlight(), actualDocumentHighlight);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations