Java 类org.eclipse.lsp4j.MessageParams 实例源码

项目:che    文件:CheLanguageClient.java   
@Override
public void logMessage(MessageParams message) {
  switch (message.getType()) {
    case Error:
      LOG.error(message.getMessage());
      break;
    case Warning:
      LOG.warn(message.getMessage());
      break;
    case Info:
      LOG.info(message.getMessage());
      break;
    case Log:
      LOG.debug(message.getMessage());
      break;
  }
}
项目:che    文件:ShowMessageProcessor.java   
public void processNotification(final MessageParams messageParams) {
  Log.debug(getClass(), "Received a 'ShowMessage' message: " + messageParams.getMessage());
  switch (messageParams.getType()) {
    case Error:
      this.notificationManager.notify(
          messageParams.getMessage(), StatusNotification.Status.FAIL, FLOAT_MODE);
      break;
    case Warning:
      this.notificationManager.notify(
          messageParams.getMessage(), StatusNotification.Status.WARNING, FLOAT_MODE);
      break;
    case Info:
    case Log:
    default:
      this.notificationManager.notify(
          messageParams.getMessage(), StatusNotification.Status.SUCCESS, FLOAT_MODE);
      break;
  }
}
项目:SOMns-vscode    文件:SomLanguageServer.java   
private void loadWorkspace(final InitializeParams params) {
  try {
    som.loadWorkspace(params.getRootUri());
  } catch (URISyntaxException e) {
    MessageParams msg = new MessageParams();
    msg.setType(MessageType.Error);
    msg.setMessage("Workspace root URI invalid: " + params.getRootUri());

    client.logMessage(msg);

    ServerLauncher.logErr(msg.getMessage());
  }
}
项目:SOMns-vscode    文件:SomAdapter.java   
public void reportError(final String msgStr) {
  MessageParams msg = new MessageParams();
  msg.setType(MessageType.Log);
  msg.setMessage(msgStr);

  client.logMessage(msg);

  ServerLauncher.logErr(msgStr);
}
项目:eclipse.jdt.ls    文件:JavaClientConnection.java   
/**
 * Sends the logMessage message back to the client as a notification
 * @param msg The message to send back to the client
 */
public void logMessage(MessageType type, String msg) {
    MessageParams $= new MessageParams();
    $.setMessage(msg);
    $.setType(type);
    client.logMessage($);
}
项目:eclipse.jdt.ls    文件:JavaClientConnection.java   
/**
 * Sends the message to the client, to be displayed on a UI element.
 *
 * @param type
 * @param msg
 */
public void showNotificationMessage(MessageType type, String msg){
    MessageParams $ = new MessageParams();
    $.setMessage(msg);
    $.setType(type);
    client.showMessage($);
}
项目:lsp4j    文件:LauncherTest.java   
@Test public void testNotification() throws IOException {

    MessageParams p = new MessageParams();
    p.setMessage("Hello World");
    p.setType(MessageType.Info);

    client.expectedNotifications.put("window/logMessage", p);
    serverLauncher.getRemoteProxy().logMessage(p);
    client.joinOnEmpty();
}
项目:che    文件:ShowMessageJsonRpcTransmitter.java   
@Inject
private void subscribe(EventService eventService) {
  eventService.subscribe(
      event ->
          endpointIds.forEach(
              endpointId ->
                  requestTransmitter
                      .newRequest()
                      .endpointId(endpointId)
                      .methodName("window/showMessage")
                      .paramsAsDto(new MessageParamsDto(event))
                      .sendAndSkipResult()),
      MessageParams.class);
}
项目:che    文件:PomReconciler.java   
public void reconcilePath(String fileLocation, String projectPath) {
  String fileName = new Path(fileLocation).lastSegment();
  if (!POM_FILE_NAME.equals(fileName)) {
    return;
  }

  EditorWorkingCopy workingCopy = editorWorkingCopyManager.getWorkingCopy(fileLocation);
  if (workingCopy == null) {
    return;
  }

  String newPomContent = workingCopy.getContentAsString();
  if (isNullOrEmpty(newPomContent)) {
    return;
  }

  List<Problem> problems;
  try {
    problems = reconcile(fileLocation, projectPath, newPomContent);
    List<Diagnostic> diagnostics = convertProblems(newPomContent, problems);
    client.publishDiagnostics(
        new PublishDiagnosticsParams(LanguageServiceUtils.prefixURI(fileLocation), diagnostics));
  } catch (ServerException | NotFoundException e) {
    LOG.error(e.getMessage(), e);
    client.showMessage(new MessageParams(MessageType.Error, "Error reconciling " + fileLocation));
  }
}
项目:che    文件:PomReconciler.java   
public void reconcileUri(String uri, String text) {
  try {
    String pomPath = LanguageServiceUtils.removePrefixUri(uri);
    List<Problem> problems = reconcile(pomPath, new File(pomPath).getParent(), text);
    List<Diagnostic> diagnostics = convertProblems(text, problems);
    client.publishDiagnostics(new PublishDiagnosticsParams(uri, diagnostics));
  } catch (ServerException | NotFoundException e) {
    LOG.error("Error reconciling content: " + uri, e);
    client.showMessage(new MessageParams(MessageType.Error, "Error reconciling " + uri));
  }
}
项目:camel-language-server    文件:AbstractCamelLanguageServerTest.java   
@Override
public void showMessage(MessageParams messageParams) {
}
项目:camel-language-server    文件:AbstractCamelLanguageServerTest.java   
@Override
public void logMessage(MessageParams message) {
}
项目:xtext-core    文件:CommandRegistryTest.java   
public void logMessage(final MessageParams message) {
  this.noImpl3.logMessage(message);
}
项目:xtext-core    文件:CommandRegistryTest.java   
public void showMessage(final MessageParams messageParams) {
  this.noImpl3.showMessage(messageParams);
}
项目:lsp4j    文件:MockLanguageClient.java   
@Override
public void showMessage(MessageParams messageParams) {
}
项目:lsp4j    文件:MockLanguageClient.java   
@Override
public void logMessage(MessageParams message) {
}
项目:che    文件:CheLanguageClient.java   
@Override
public void showMessage(MessageParams messageParams) {
  eventService.publish(messageParams);
}
项目:camel-language-server    文件:CamelLanguageServer.java   
/**
 * Sends the given <code>log message notification</code> back to the client
 * as a notification
 * 
 * @param type
 *            the type of message
 * @param msg
 *            The message to send back to the client
 */
public void sendLogMessageNotification(final MessageType type, final String msg) {
    client.logMessage(new MessageParams(type, msg));
}
项目:camel-language-server    文件:CamelLanguageServer.java   
/**
 * Sends the given <code>show message notification</code> back to the client
 * as a notification
 * 
 * @param type
 *            the type of message
 * @param msg
 *            The message to send back to the client
 */
public void sendShowMessageNotification(final MessageType type, final String msg) {
    client.showMessage(new MessageParams(type, msg));
}
项目:SOMns-vscode    文件:LanguageClient.java   
/**
 * The show message notification is sent from a server to a client to ask
 * the client to display a particular message in the user interface.
 */
@JsonNotification("window/showMessage")
void showMessage(MessageParams messageParams);
项目:SOMns-vscode    文件:LanguageClient.java   
/**
 * The log message notification is send from the server to the client to ask
 * the client to log a particular message.
 */
@JsonNotification("window/logMessage")
void logMessage(MessageParams message);
项目:lsp4j    文件:LanguageClient.java   
/**
 * The show message notification is sent from a server to a client to ask
 * the client to display a particular message in the user interface.
 */
@JsonNotification("window/showMessage")
void showMessage(MessageParams messageParams);
项目:lsp4j    文件:LanguageClient.java   
/**
 * The log message notification is send from the server to the client to ask
 * the client to log a particular message.
 */
@JsonNotification("window/logMessage")
void logMessage(MessageParams message);