当前位置: 首页>>代码示例>>Java>>正文


Java MessageParams类代码示例

本文整理汇总了Java中org.eclipse.lsp4j.MessageParams的典型用法代码示例。如果您正苦于以下问题:Java MessageParams类的具体用法?Java MessageParams怎么用?Java MessageParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MessageParams类属于org.eclipse.lsp4j包,在下文中一共展示了MessageParams类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: logMessage

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@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;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:CheLanguageClient.java

示例2: processNotification

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
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;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:ShowMessageProcessor.java

示例3: loadWorkspace

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
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());
  }
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:14,代码来源:SomLanguageServer.java

示例4: reportError

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
public void reportError(final String msgStr) {
  MessageParams msg = new MessageParams();
  msg.setType(MessageType.Log);
  msg.setMessage(msgStr);

  client.logMessage(msg);

  ServerLauncher.logErr(msgStr);
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:10,代码来源:SomAdapter.java

示例5: logMessage

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
/**
 * 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($);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:11,代码来源:JavaClientConnection.java

示例6: showNotificationMessage

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
/**
 * 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($);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:13,代码来源:JavaClientConnection.java

示例7: testNotification

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@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();
}
 
开发者ID:eclipse,项目名称:lsp4j,代码行数:11,代码来源:LauncherTest.java

示例8: subscribe

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:15,代码来源:ShowMessageJsonRpcTransmitter.java

示例9: reconcilePath

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
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));
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:28,代码来源:PomReconciler.java

示例10: reconcileUri

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
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));
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:PomReconciler.java

示例11: showMessage

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@Override
public void showMessage(MessageParams messageParams) {
}
 
开发者ID:lhein,项目名称:camel-language-server,代码行数:4,代码来源:AbstractCamelLanguageServerTest.java

示例12: logMessage

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@Override
public void logMessage(MessageParams message) {
}
 
开发者ID:lhein,项目名称:camel-language-server,代码行数:4,代码来源:AbstractCamelLanguageServerTest.java

示例13: logMessage

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
public void logMessage(final MessageParams message) {
  this.noImpl3.logMessage(message);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:CommandRegistryTest.java

示例14: showMessage

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
public void showMessage(final MessageParams messageParams) {
  this.noImpl3.showMessage(messageParams);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:CommandRegistryTest.java

示例15: showMessage

import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@Override
public void showMessage(MessageParams messageParams) {
  eventService.publish(messageParams);
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:CheLanguageClient.java


注:本文中的org.eclipse.lsp4j.MessageParams类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。