Implement highlighter support for eclipse language servers
This commit is contained in:
@@ -14,7 +14,8 @@ Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0",
|
||||
org.eclipse.lsp4j,
|
||||
org.eclipse.ui.workbench,
|
||||
org.eclipse.jface,
|
||||
org.eclipse.xtext.xbase.lib
|
||||
org.eclipse.xtext.xbase.lib,
|
||||
org.springframework.tooling.ls.eclipse.commons
|
||||
Import-Package: com.google.gson;version="2.7.0",
|
||||
org.eclipse.jface.preference,
|
||||
org.eclipse.lsp4j.jsonrpc.messages;version="0.1.0.v20170117-0759",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<server
|
||||
class="org.springframework.tooling.boot.java.ls.DelegatingStreamConnectionProvider"
|
||||
id="org.eclipse.languageserver.languages.springbootjava"
|
||||
clientImpl="org.springframework.tooling.ls.eclipse.commons.STS4LanguageClientImpl"
|
||||
label="Spring Boot Java Language Server">
|
||||
</server>
|
||||
<contentTypeMapping
|
||||
|
||||
@@ -12,6 +12,7 @@ package org.springframework.tooling.boot.java.ls;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.ArrayList;
|
||||
@@ -57,38 +58,6 @@ public class SpringBootJavaLanguageServer extends ProcessStreamConnectionProvide
|
||||
setWorkingDirectory(workingDir);
|
||||
}
|
||||
|
||||
public void handleMessage(Message message, LanguageServer languageServer, String rootPath) {
|
||||
if (message instanceof NotificationMessage) {
|
||||
NotificationMessage notificationMessage = (NotificationMessage) message;
|
||||
if ("sts/progress".equals(notificationMessage.getMethod())) {
|
||||
JsonObject params = (JsonObject) notificationMessage.getParams();
|
||||
String status = params.has("statusMsg") ? params.get("statusMsg").getAsString() : "";
|
||||
showStatusMessage(status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void showStatusMessage(final String status) {
|
||||
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IStatusLineManager statusLineManager = getStatusLineManager();
|
||||
if (statusLineManager != null) {
|
||||
statusLineManager.setMessage(status);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private IStatusLineManager getStatusLineManager() {
|
||||
try {
|
||||
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars().getStatusLineManager();
|
||||
}
|
||||
catch (NullPointerException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected String getJDKLocation() {
|
||||
File jre = new File(System.getProperty("java.home"));
|
||||
File javaExecutable = StandardVMType.findJavaExecutable(jre);
|
||||
|
||||
Reference in New Issue
Block a user