use of org.eclipse.lsp4j.SignatureHelpParams in project xtext-core by eclipse.
the class AbstractLanguageServerTest method testSignatureHelp.
protected void testSignatureHelp(final Procedure1<? super SignatureHelpConfiguration> configurator) {
try {
@Extension final SignatureHelpConfiguration configuration = new SignatureHelpConfiguration();
configuration.setFilePath(("MyModel." + this.fileExtension));
configurator.apply(configuration);
final String fileUri = this.initializeContext(configuration).getUri();
SignatureHelpParams _signatureHelpParams = new SignatureHelpParams();
final Procedure1<SignatureHelpParams> _function = (SignatureHelpParams 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);
};
SignatureHelpParams _doubleArrow = ObjectExtensions.<SignatureHelpParams>operator_doubleArrow(_signatureHelpParams, _function);
final CompletableFuture<SignatureHelp> signatureHelpFuture = this.languageServer.signatureHelp(_doubleArrow);
final SignatureHelp signatureHelp = signatureHelpFuture.get();
Procedure1<? super SignatureHelp> _assertSignatureHelp = configuration.getAssertSignatureHelp();
boolean _tripleNotEquals = (_assertSignatureHelp != null);
if (_tripleNotEquals) {
configuration.getAssertSignatureHelp().apply(signatureHelp);
} else {
final String actualSignatureHelp = this.toExpectation(signatureHelp);
this.assertEquals(configuration.getExpectedSignatureHelp().trim(), actualSignatureHelp.trim());
}
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations