本文整理汇总了Java中org.eclipse.lsp4j.ShowMessageRequestParams类的典型用法代码示例。如果您正苦于以下问题:Java ShowMessageRequestParams类的具体用法?Java ShowMessageRequestParams怎么用?Java ShowMessageRequestParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShowMessageRequestParams类属于org.eclipse.lsp4j包,在下文中一共展示了ShowMessageRequestParams类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendShowMessageRequest
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
public CompletableFuture<MessageActionItem> sendShowMessageRequest(
ShowMessageRequestParams requestParams) {
CompletableFuture<MessageActionItem> result = new CompletableFuture<>();
if (showMessageRequestEndpointIds.isEmpty()) {
result.complete(null);
}
for (String endpointId : endpointIds) {
requestTransmitter
.newRequest()
.endpointId(endpointId)
.methodName("window/showMessageRequest")
.paramsAsDto(requestParams)
.sendAndReceiveResultAsDto(MessageActionItem.class)
.onSuccess(
actionItem -> {
if (!result.isDone()) {
result.complete(actionItem);
}
})
.onFailure(
jsonRpcError ->
result.completeExceptionally(new Exception(jsonRpcError.getMessage())));
}
return result;
}
示例2: testName
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Test
public void testName() throws Exception {
CompletableFuture<MessageActionItem> future = new CompletableFuture<>();
when(transmitter.sendShowMessageRequest(any())).thenReturn(future);
ServerInitializerImpl initializer = new ServerInitializerImpl();
CheLanguageClient client = new CheLanguageClient(eventService, transmitter, "id");
CompletableFuture<Pair<LanguageServer, InitializeResult>> initialize =
initializer.initialize(launcher, client, "/tmp");
Pair<LanguageServer, InitializeResult> resultPair = initialize.get();
server = resultPair.first;
ArgumentCaptor<ShowMessageRequestParams> captor =
ArgumentCaptor.forClass(ShowMessageRequestParams.class);
verify(transmitter, timeout(1500)).sendShowMessageRequest(captor.capture());
ShowMessageRequestParams value = captor.getValue();
assertNotNull(value);
assertEquals(value.getType(), MessageType.Error);
assertEquals(value.getMessage(), "Error Message!!!!");
}
示例3: processNotificationRequest
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
public JsonRpcPromise<MessageActionItem> processNotificationRequest(
ShowMessageRequestParams params) {
JsonRpcPromise<MessageActionItem> result = new JsonRpcPromise<>();
MessageDialogPresenter dialogPresenter = provider.get();
dialogPresenter.show(
params.getMessage(),
params.getType().toString(),
params.getActions(),
actionItem -> {
result
.getSuccessConsumer()
.ifPresent(consumer -> consumer.accept("ws-agent", actionItem));
});
return result;
}
示例4: configureReceiver
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Inject
private void configureReceiver(
Provider<ShowMessageProcessor> provider, RequestHandlerConfigurator configurator) {
configurator
.newConfiguration()
.methodName("window/showMessage")
.paramsAsDto(ShowMessageRequestParams.class)
.noResult()
.withConsumer(params -> provider.get().processNotification(params));
}
示例5: configureShowMessageRequestReceiver
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Inject
private void configureShowMessageRequestReceiver(
Provider<ShowMessageRequestProcessor> provider, RequestHandlerConfigurator configurator) {
configurator
.newConfiguration()
.methodName("window/showMessageRequest")
.paramsAsDto(ShowMessageRequestParams.class)
.resultAsPromiseDto(MessageActionItem.class)
.withPromise(params -> provider.get().processNotificationRequest(params));
}
示例6: showMessageRequest
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Override
public CompletableFuture<MessageActionItem> showMessageRequest(ShowMessageRequestParams requestParams) {
return null;
}
示例7: showMessageRequest
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
public CompletableFuture<MessageActionItem> showMessageRequest(final ShowMessageRequestParams requestParams) {
return this.noImpl3.showMessageRequest(requestParams);
}
示例8: showMessageRequest
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Override
public CompletableFuture<MessageActionItem> showMessageRequest(ShowMessageRequestParams requestParams) {
throw new UnsupportedOperationException();
}
示例9: showMessageRequest
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
@Override
public CompletableFuture<MessageActionItem> showMessageRequest(
ShowMessageRequestParams requestParams) {
return transmitter.sendShowMessageRequest(requestParams);
}
示例10: showNotificationMessageRequest
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
/**
* Sends the message to the client, to be displayed on a UI element.
* Waits for an answer from the user and returns the selected
* action.
*
* @param type
* @param msg
* @return
*/
public MessageActionItem showNotificationMessageRequest(MessageType type, String msg, List<MessageActionItem> actions){
ShowMessageRequestParams $ = new ShowMessageRequestParams();
$.setMessage(msg);
$.setType(type);
$.setActions(actions);
return client.showMessageRequest($).join();
}
示例11: showMessageRequest
import org.eclipse.lsp4j.ShowMessageRequestParams; //导入依赖的package包/类
/**
* The show message request is sent from a server to a client to ask the
* client to display a particular message in the user interface. In addition
* to the show message notification the request allows to pass actions and
* to wait for an answer from the client.
*/
@JsonRequest("window/showMessageRequest")
CompletableFuture<MessageActionItem> showMessageRequest(ShowMessageRequestParams requestParams);