本文整理汇总了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;
}
}
示例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;
}
}
示例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());
}
}
示例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);
}
示例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($);
}
示例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($);
}
示例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();
}
示例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);
}
示例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));
}
}
示例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));
}
}
示例11: showMessage
import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@Override
public void showMessage(MessageParams messageParams) {
}
示例12: logMessage
import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@Override
public void logMessage(MessageParams message) {
}
示例13: logMessage
import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
public void logMessage(final MessageParams message) {
this.noImpl3.logMessage(message);
}
示例14: showMessage
import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
public void showMessage(final MessageParams messageParams) {
this.noImpl3.showMessage(messageParams);
}
示例15: showMessage
import org.eclipse.lsp4j.MessageParams; //导入依赖的package包/类
@Override
public void showMessage(MessageParams messageParams) {
eventService.publish(messageParams);
}