diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers.feature/build.properties b/eclipse-language-servers/org.springframework.tooling.boot.java.ls.feature/build.properties similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers.feature/build.properties rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls.feature/build.properties diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers.feature/feature.xml b/eclipse-language-servers/org.springframework.tooling.boot.java.ls.feature/feature.xml similarity index 78% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers.feature/feature.xml rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls.feature/feature.xml index 310128412..6def1606c 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers.feature/feature.xml +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls.feature/feature.xml @@ -1,6 +1,6 @@ @@ -11,7 +11,7 @@ ../pom.xml - org.springframework.boot.ide.properties.servers.feature + org.springframework.tooling.boot.java.ls.feature eclipse-feature diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/.classpath b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/.classpath similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/.classpath rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/.classpath diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/.project b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/.project similarity index 91% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/.project rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/.project index 1dac181c4..17dc13dae 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/.project +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/.project @@ -1,6 +1,6 @@ - org.springframework.boot.ide.java.servers + org.springframework.tooling.boot.java.ls diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/.settings/org.eclipse.jdt.core.prefs b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/.settings/org.eclipse.jdt.core.prefs rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/.settings/org.eclipse.jdt.core.prefs diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/META-INF/MANIFEST.MF b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/META-INF/MANIFEST.MF similarity index 86% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/META-INF/MANIFEST.MF rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/META-INF/MANIFEST.MF index e93d746a6..eebaa526c 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/META-INF/MANIFEST.MF +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: Servers -Bundle-SymbolicName: org.springframework.boot.ide.java.servers;singleton:=true +Bundle-Name: Spring Boot Java Language Server +Bundle-SymbolicName: org.springframework.tooling.boot.java.ls;singleton:=true Bundle-Version: 4.0.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0", diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/build.properties b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/build.properties similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/build.properties rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/build.properties diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/plugin.xml b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/plugin.xml similarity index 79% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/plugin.xml rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/plugin.xml index e8a6c483e..127ea24f3 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/plugin.xml +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/plugin.xml @@ -5,7 +5,7 @@ @@ -21,7 +21,7 @@ @@ -30,7 +30,7 @@ point="org.eclipse.jdt.ui.javaEditorTextHovers"> diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/pom.xml b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/pom.xml similarity index 93% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/pom.xml rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/pom.xml index 8006dcb30..ec62bcc57 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/pom.xml +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/pom.xml @@ -11,14 +11,14 @@ ../pom.xml - org.springframework.boot.ide.java.servers + org.springframework.tooling.boot.java.ls eclipse-plugin org.springframework.ide.vscode boot-java-language-server - 0.0.2-SNAPSHOT + 0.0.9-SNAPSHOT diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/Constants.java b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/Constants.java similarity index 74% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/Constants.java rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/Constants.java index 6139c2f01..4cb92c923 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/Constants.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/Constants.java @@ -8,14 +8,14 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.java.servers; +package org.springframework.tooling.boot.java.ls; /** * @author Martin Lippert */ public class Constants { - public static final String PLUGIN_ID = "org.springframework.boot.ide.java.servers"; - public static final String LANGUAGE_SERVER_VERSION = "0.0.2"; + public static final String PLUGIN_ID = "org.springframework.tooling.boot.java.ls"; + public static final String LANGUAGE_SERVER_VERSION = "0.0.9"; } diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/DelegatingStreamConnectionProvider.java b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/DelegatingStreamConnectionProvider.java similarity index 97% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/DelegatingStreamConnectionProvider.java rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/DelegatingStreamConnectionProvider.java index d5b659eea..6ce301fc5 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/DelegatingStreamConnectionProvider.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/DelegatingStreamConnectionProvider.java @@ -8,7 +8,7 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.java.servers; +package org.springframework.tooling.boot.java.ls; import java.io.IOException; import java.io.InputStream; diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaLanguageServer.java b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/SpringBootJavaLanguageServer.java similarity index 98% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaLanguageServer.java rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/SpringBootJavaLanguageServer.java index 22ed18e80..1fd9c589e 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaLanguageServer.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/SpringBootJavaLanguageServer.java @@ -8,7 +8,7 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.java.servers; +package org.springframework.tooling.boot.java.ls; import java.io.File; import java.io.InputStream; diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaLanguageServerViaSocket.java b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/SpringBootJavaLanguageServerViaSocket.java similarity index 96% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaLanguageServerViaSocket.java rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/SpringBootJavaLanguageServerViaSocket.java index 518bba96d..2c2c911a7 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaLanguageServerViaSocket.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/SpringBootJavaLanguageServerViaSocket.java @@ -8,7 +8,7 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.java.servers; +package org.springframework.tooling.boot.java.ls; import java.io.IOException; import java.io.InputStream; diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaCompletionProposalComputer.java b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/jdt/SpringBootJavaCompletionProposalComputer.java similarity index 97% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaCompletionProposalComputer.java rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/jdt/SpringBootJavaCompletionProposalComputer.java index fd1b72ae7..fddb5075f 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaCompletionProposalComputer.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/jdt/SpringBootJavaCompletionProposalComputer.java @@ -8,7 +8,7 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.java.servers; +package org.springframework.tooling.boot.java.ls.jdt; import java.util.Arrays; import java.util.List; diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaHoverProvider.java b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/jdt/SpringBootJavaHoverProvider.java similarity index 96% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaHoverProvider.java rename to eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/jdt/SpringBootJavaHoverProvider.java index eabc1d7b0..aea387a45 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers/src/org/springframework/boot/ide/java/servers/SpringBootJavaHoverProvider.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.java.ls/src/org/springframework/tooling/boot/java/ls/jdt/SpringBootJavaHoverProvider.java @@ -8,7 +8,7 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.java.servers; +package org.springframework.tooling.boot.java.ls.jdt; import org.eclipse.jdt.ui.text.java.hover.IJavaEditorTextHover; import org.eclipse.jface.text.IRegion; diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers.feature/build.properties b/eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/build.properties similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers.feature/build.properties rename to eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/build.properties diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers.feature/feature.xml b/eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/feature.xml similarity index 77% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers.feature/feature.xml rename to eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/feature.xml index 291e4be72..f84aa822a 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers.feature/feature.xml +++ b/eclipse-language-servers/org.springframework.tooling.bosh.ls.feature/feature.xml @@ -1,6 +1,6 @@ @@ -11,7 +11,7 @@ ../pom.xml - org.springframework.boot.ide.cloudfoundry.manifest.integration.feature + org.springframework.tooling.bosh.ls.feature eclipse-feature - + diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/.classpath b/eclipse-language-servers/org.springframework.tooling.bosh.ls/.classpath similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/.classpath rename to eclipse-language-servers/org.springframework.tooling.bosh.ls/.classpath diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/.project b/eclipse-language-servers/org.springframework.tooling.bosh.ls/.project similarity index 90% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/.project rename to eclipse-language-servers/org.springframework.tooling.bosh.ls/.project index 5eed86bdb..bf71d92dd 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/.project +++ b/eclipse-language-servers/org.springframework.tooling.bosh.ls/.project @@ -1,6 +1,6 @@ - org.springframework.boot.ide.properties.servers + org.springframework.tooling.bosh.ls diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers/.settings/org.eclipse.jdt.core.prefs b/eclipse-language-servers/org.springframework.tooling.bosh.ls/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers/.settings/org.eclipse.jdt.core.prefs rename to eclipse-language-servers/org.springframework.tooling.bosh.ls/.settings/org.eclipse.jdt.core.prefs diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/META-INF/MANIFEST.MF b/eclipse-language-servers/org.springframework.tooling.bosh.ls/META-INF/MANIFEST.MF similarity index 90% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/META-INF/MANIFEST.MF rename to eclipse-language-servers/org.springframework.tooling.bosh.ls/META-INF/MANIFEST.MF index ee2ce9ef6..e447f04ab 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/META-INF/MANIFEST.MF +++ b/eclipse-language-servers/org.springframework.tooling.bosh.ls/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Servers -Bundle-SymbolicName: org.springframework.boot.ide.properties.servers;singleton:=true +Bundle-SymbolicName: org.springframework.tooling.bosh.ls;singleton:=true Bundle-Version: 4.0.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0", diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/build.properties b/eclipse-language-servers/org.springframework.tooling.bosh.ls/build.properties similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/build.properties rename to eclipse-language-servers/org.springframework.tooling.bosh.ls/build.properties diff --git a/eclipse-language-servers/org.springframework.tooling.bosh.ls/plugin.xml b/eclipse-language-servers/org.springframework.tooling.bosh.ls/plugin.xml new file mode 100644 index 000000000..7f8ae7c10 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.bosh.ls/plugin.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-language-servers/org.springframework.tooling.bosh.ls/pom.xml b/eclipse-language-servers/org.springframework.tooling.bosh.ls/pom.xml new file mode 100644 index 000000000..37c7c955c --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.bosh.ls/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + org.springframework.boot.ide + org.springframework.boot.ide.servers + 4.0.0-SNAPSHOT + ../pom.xml + + + org.springframework.tooling.bosh.ls + eclipse-plugin + + + + org.springframework.ide.vscode + bosh-language-server + 0.0.9-SNAPSHOT + + + org.springframework.ide.eclipse + org.json + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + copy + prepare-package + + copy + + + + + org.springframework.ide.vscode + bosh-language-server + true + ${project.build.directory}/../servers + + + true + true + + + + + + + + diff --git a/eclipse-language-servers/org.springframework.tooling.bosh.ls/src/org/springframework/tooling/bosh/ls/BoshLanguageServer.java b/eclipse-language-servers/org.springframework.tooling.bosh.ls/src/org/springframework/tooling/bosh/ls/BoshLanguageServer.java new file mode 100644 index 000000000..356ba1118 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.bosh.ls/src/org/springframework/tooling/bosh/ls/BoshLanguageServer.java @@ -0,0 +1,122 @@ +/******************************************************************************* + * Copyright (c) 2016, 2017 Pivotal, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Pivotal, Inc. - initial API and implementation + *******************************************************************************/ +package org.springframework.tooling.bosh.ls; + +import java.io.File; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jdt.internal.launching.StandardVMType; +import org.eclipse.jdt.launching.IVMInstall; +import org.eclipse.jdt.launching.JavaRuntime; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.lsp4e.server.ProcessStreamConnectionProvider; +import org.eclipse.lsp4j.jsonrpc.messages.Message; +import org.eclipse.lsp4j.jsonrpc.messages.NotificationMessage; +import org.eclipse.lsp4j.services.LanguageServer; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.Bundle; + +import com.google.gson.JsonObject; + +/** + * @author Martin Lippert + */ +@SuppressWarnings("restriction") +public class BoshLanguageServer extends ProcessStreamConnectionProvider { + + public BoshLanguageServer() { + List commands = new ArrayList<>(); + commands.add(getJDKLocation()); + commands.add("-jar"); + commands.add(getLanguageServerJARLocation()); + + String workingDir = getWorkingDirLocation(); + + setCommands(commands); + 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() { + IVMInstall jdk = JavaRuntime.getDefaultVMInstall(); + File javaExecutable = StandardVMType.findJavaExecutable(jdk.getInstallLocation()); + return javaExecutable.getAbsolutePath(); + } + + protected String getLanguageServerJARLocation() { + String languageServer = "bosh-language-server-" + Constants.LANGUAGE_SERVER_VERSION + "-SNAPSHOT.jar"; + + Bundle bundle = Platform.getBundle(Constants.PLUGIN_ID); + File dataFile = bundle.getDataFile(languageServer); +// if (!dataFile.exists()) { + try { + copyLanguageServerJAR(languageServer); + } + catch (Exception e) { + e.printStackTrace(); + } +// } + + return dataFile.getAbsolutePath(); + } + + protected String getWorkingDirLocation() { + // TODO: identify a reasonable working directory for the language server process + return System.getProperty("user.dir"); + } + + protected void copyLanguageServerJAR(String languageServerJarName) throws Exception { + Bundle bundle = Platform.getBundle(Constants.PLUGIN_ID); + InputStream stream = FileLocator.openStream( bundle, new Path("servers/" + languageServerJarName), false ); + + File dataFile = bundle.getDataFile(languageServerJarName); + Files.copy(stream, dataFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + +} diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/Constants.java b/eclipse-language-servers/org.springframework.tooling.bosh.ls/src/org/springframework/tooling/bosh/ls/Constants.java similarity index 73% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/Constants.java rename to eclipse-language-servers/org.springframework.tooling.bosh.ls/src/org/springframework/tooling/bosh/ls/Constants.java index c2c28ee3e..3f1e9ada5 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/Constants.java +++ b/eclipse-language-servers/org.springframework.tooling.bosh.ls/src/org/springframework/tooling/bosh/ls/Constants.java @@ -8,14 +8,14 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.properties.servers; +package org.springframework.tooling.bosh.ls; /** * @author Martin Lippert */ public class Constants { - public static final String PLUGIN_ID = "org.springframework.boot.ide.properties.servers"; - public static final String LANGUAGE_SERVER_VERSION = "0.0.2"; + public static final String PLUGIN_ID = "org.springframework.tooling.bosh.ls"; + public static final String LANGUAGE_SERVER_VERSION = "0.0.9"; } diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/syntaxes/YAML.tmLanguage b/eclipse-language-servers/org.springframework.tooling.bosh.ls/syntaxes/YAML.tmLanguage similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/syntaxes/YAML.tmLanguage rename to eclipse-language-servers/org.springframework.tooling.bosh.ls/syntaxes/YAML.tmLanguage diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration.feature/build.properties b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/build.properties similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration.feature/build.properties rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/build.properties diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration.feature/feature.xml b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/feature.xml similarity index 72% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration.feature/feature.xml rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/feature.xml index cda3dfb10..256fb7292 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration.feature/feature.xml +++ b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature/feature.xml @@ -1,6 +1,6 @@ @@ -11,7 +11,7 @@ + + 4.0.0 + + org.springframework.boot.ide + org.springframework.boot.ide.servers + 4.0.0-SNAPSHOT + ../pom.xml + + + org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature + eclipse-feature + + diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/.classpath b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/.classpath similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/.classpath rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/.classpath diff --git a/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/.project b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/.project new file mode 100644 index 000000000..d564d4c2a --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/.project @@ -0,0 +1,28 @@ + + + org.springframework.tooling.cloudfoundry.manifest.ls.integration + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/.settings/org.eclipse.jdt.core.prefs b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/.settings/org.eclipse.jdt.core.prefs rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/.settings/org.eclipse.jdt.core.prefs diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/META-INF/MANIFEST.MF b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/META-INF/MANIFEST.MF similarity index 88% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/META-INF/MANIFEST.MF rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/META-INF/MANIFEST.MF index 4ec999671..1a1d742bc 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/META-INF/MANIFEST.MF +++ b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Server -Bundle-SymbolicName: org.springframework.boot.ide.cloudfoundry.manifest.integration;singleton:=true +Bundle-SymbolicName: org.springframework.tooling.cloudfoundry.manifest.ls.integration;singleton:=true Bundle-Version: 4.0.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0", diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/build.properties b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/build.properties similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/build.properties rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/build.properties diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/plugin.xml b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/plugin.xml similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/plugin.xml rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/plugin.xml diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/pom.xml b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/pom.xml similarity index 85% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/pom.xml rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/pom.xml index 55cc66c0c..5011ad072 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/pom.xml +++ b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/pom.xml @@ -11,7 +11,7 @@ ../pom.xml - org.springframework.boot.ide.cloudfoundry.manifest.integration + org.springframework.tooling.cloudfoundry.manifest.ls.integration eclipse-plugin diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/syntaxes/YAML.tmLanguage b/eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/syntaxes/YAML.tmLanguage similarity index 100% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/syntaxes/YAML.tmLanguage rename to eclipse-language-servers/org.springframework.tooling.cloudfoundry.manifest.ls.integration/syntaxes/YAML.tmLanguage diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/build.properties b/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/build.properties new file mode 100644 index 000000000..64f93a9f0 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/feature.xml b/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/feature.xml new file mode 100644 index 000000000..fb169bf4b --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/feature.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/pom.xml b/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/pom.xml new file mode 100644 index 000000000..ae30eefec --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls.feature/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + org.springframework.boot.ide + org.springframework.boot.ide.servers + 4.0.0-SNAPSHOT + ../pom.xml + + + org.springframework.tooling.concourse.ls.feature + eclipse-feature + + diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/.classpath b/eclipse-language-servers/org.springframework.tooling.concourse.ls/.classpath new file mode 100644 index 000000000..eca7bdba8 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/.project b/eclipse-language-servers/org.springframework.tooling.concourse.ls/.project similarity index 88% rename from eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/.project rename to eclipse-language-servers/org.springframework.tooling.concourse.ls/.project index f3f895a4c..a06006ee6 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.cloudfoundry.manifest.integration/.project +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/.project @@ -1,6 +1,6 @@ - org.springframework.boot.ide.cloudfoundry.manifest.integration + org.springframework.tooling.concourse.ls diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/.settings/org.eclipse.jdt.core.prefs b/eclipse-language-servers/org.springframework.tooling.concourse.ls/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..0c68a61dc --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/META-INF/MANIFEST.MF b/eclipse-language-servers/org.springframework.tooling.concourse.ls/META-INF/MANIFEST.MF new file mode 100644 index 000000000..79b325123 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Servers +Bundle-SymbolicName: org.springframework.tooling.concourse.ls;singleton:=true +Bundle-Version: 4.0.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0", + org.eclipse.core.runtime;bundle-version="3.12.0", + org.eclipse.lsp4e;bundle-version="0.1.0", + org.eclipse.ui.genericeditor;bundle-version="1.0.0", + org.eclipse.jface.text;bundle-version="3.11.100", + org.eclipse.jdt.ui;bundle-version="3.13.0", + org.eclipse.tm4e.core;bundle-version="0.1.0", + org.eclipse.tm4e.ui;bundle-version="0.1.0", + org.eclipse.lsp4j, + org.eclipse.ui.workbench, + org.eclipse.jface +Import-Package: com.google.gson;version="2.7.0", + org.eclipse.jface.preference, + org.eclipse.lsp4j.jsonrpc.messages;version="0.1.0.v20170117-0759", + org.eclipse.lsp4j.services;version="0.1.0.v20170117-0759", + org.osgi.framework diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/build.properties b/eclipse-language-servers/org.springframework.tooling.concourse.ls/build.properties new file mode 100644 index 000000000..8e982bda7 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + servers/,\ + syntaxes/ diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/plugin.xml b/eclipse-language-servers/org.springframework.tooling.concourse.ls/plugin.xml new file mode 100644 index 000000000..7c4f86313 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/plugin.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/pom.xml b/eclipse-language-servers/org.springframework.tooling.concourse.ls/pom.xml new file mode 100644 index 000000000..ad6b34782 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + org.springframework.boot.ide + org.springframework.boot.ide.servers + 4.0.0-SNAPSHOT + ../pom.xml + + + org.springframework.tooling.concourse.ls + eclipse-plugin + + + + org.springframework.ide.vscode + concourse-language-server + 0.0.9-SNAPSHOT + + + org.springframework.ide.eclipse + org.json + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + copy + prepare-package + + copy + + + + + org.springframework.ide.vscode + concourse-language-server + true + ${project.build.directory}/../servers + + + true + true + + + + + + + + diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/src/org/springframework/tooling/concourse/ls/ConcourseLanguageServer.java b/eclipse-language-servers/org.springframework.tooling.concourse.ls/src/org/springframework/tooling/concourse/ls/ConcourseLanguageServer.java new file mode 100644 index 000000000..16f38c1cd --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/src/org/springframework/tooling/concourse/ls/ConcourseLanguageServer.java @@ -0,0 +1,122 @@ +/******************************************************************************* + * Copyright (c) 2016, 2017 Pivotal, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Pivotal, Inc. - initial API and implementation + *******************************************************************************/ +package org.springframework.tooling.concourse.ls; + +import java.io.File; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jdt.internal.launching.StandardVMType; +import org.eclipse.jdt.launching.IVMInstall; +import org.eclipse.jdt.launching.JavaRuntime; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.lsp4e.server.ProcessStreamConnectionProvider; +import org.eclipse.lsp4j.jsonrpc.messages.Message; +import org.eclipse.lsp4j.jsonrpc.messages.NotificationMessage; +import org.eclipse.lsp4j.services.LanguageServer; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.Bundle; + +import com.google.gson.JsonObject; + +/** + * @author Martin Lippert + */ +@SuppressWarnings("restriction") +public class ConcourseLanguageServer extends ProcessStreamConnectionProvider { + + public ConcourseLanguageServer() { + List commands = new ArrayList<>(); + commands.add(getJDKLocation()); + commands.add("-jar"); + commands.add(getLanguageServerJARLocation()); + + String workingDir = getWorkingDirLocation(); + + setCommands(commands); + 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() { + IVMInstall jdk = JavaRuntime.getDefaultVMInstall(); + File javaExecutable = StandardVMType.findJavaExecutable(jdk.getInstallLocation()); + return javaExecutable.getAbsolutePath(); + } + + protected String getLanguageServerJARLocation() { + String languageServer = "concourse-language-server-" + Constants.LANGUAGE_SERVER_VERSION + "-SNAPSHOT.jar"; + + Bundle bundle = Platform.getBundle(Constants.PLUGIN_ID); + File dataFile = bundle.getDataFile(languageServer); +// if (!dataFile.exists()) { + try { + copyLanguageServerJAR(languageServer); + } + catch (Exception e) { + e.printStackTrace(); + } +// } + + return dataFile.getAbsolutePath(); + } + + protected String getWorkingDirLocation() { + // TODO: identify a reasonable working directory for the language server process + return System.getProperty("user.dir"); + } + + protected void copyLanguageServerJAR(String languageServerJarName) throws Exception { + Bundle bundle = Platform.getBundle(Constants.PLUGIN_ID); + InputStream stream = FileLocator.openStream( bundle, new Path("servers/" + languageServerJarName), false ); + + File dataFile = bundle.getDataFile(languageServerJarName); + Files.copy(stream, dataFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + +} diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/src/org/springframework/tooling/concourse/ls/Constants.java b/eclipse-language-servers/org.springframework.tooling.concourse.ls/src/org/springframework/tooling/concourse/ls/Constants.java new file mode 100644 index 000000000..653a142ec --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/src/org/springframework/tooling/concourse/ls/Constants.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2016, 2017 Pivotal, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Pivotal, Inc. - initial API and implementation + *******************************************************************************/ +package org.springframework.tooling.concourse.ls; + +/** + * @author Martin Lippert + */ +public class Constants { + + public static final String PLUGIN_ID = "org.springframework.tooling.concourse.ls"; + public static final String LANGUAGE_SERVER_VERSION = "0.0.9"; + +} diff --git a/eclipse-language-servers/org.springframework.tooling.concourse.ls/syntaxes/YAML.tmLanguage b/eclipse-language-servers/org.springframework.tooling.concourse.ls/syntaxes/YAML.tmLanguage new file mode 100644 index 000000000..efc4c8ab0 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.concourse.ls/syntaxes/YAML.tmLanguage @@ -0,0 +1,1164 @@ + + + + + fileTypes + + yaml + yml + rviz + reek + clang-format + yaml-tmlanguage + syntax + sublime-syntax + + firstLineMatch + ^%YAML( ?1.\d+)? + keyEquivalent + ^~Y + name + YAML + patterns + + + include + #comment + + + include + #property + + + include + #directive + + + match + ^--- + name + entity.other.document.begin.yaml + + + match + ^\.{3} + name + entity.other.document.end.yaml + + + include + #node + + + repository + + block-collection + + patterns + + + include + #block-sequence + + + include + #block-mapping + + + + block-mapping + + patterns + + + include + #block-pair + + + + block-node + + patterns + + + include + #prototype + + + include + #block-scalar + + + include + #block-collection + + + include + #flow-scalar-plain-out + + + include + #flow-node + + + + block-pair + + patterns + + + begin + \? + beginCaptures + + 1 + + name + punctuation.definition.key-value.begin.yaml + + + end + (?=\?)|^ *(:)|(:) + endCaptures + + 1 + + name + punctuation.separator.key-value.mapping.yaml + + 2 + + name + invalid.illegal.expected-newline.yaml + + + name + meta.block-mapping.yaml + patterns + + + include + #block-node + + + + + begin + (?x) + (?= + (?x: + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + ) + ( + [^\s:] + | : \S + | \s+ (?![#\s]) + )* + \s* + : + (\s|$) + ) + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + patterns + + + include + #flow-scalar-plain-out-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + + beginCaptures + + 0 + + name + entity.name.tag.yaml + + + contentName + entity.name.tag.yaml + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + name + string.unquoted.plain.out.yaml + + + + + match + :(?=\s|$) + name + punctuation.separator.key-value.mapping.yaml + + + + block-scalar + + begin + (?:(\|)|(>))([1-9])?([-+])?(.*\n?) + beginCaptures + + 1 + + name + punctuation.definition.block.scalar.literal.yaml + + 2 + + name + punctuation.definition.block.scalar.folded.yaml + + 3 + + name + constant.numeric.indentation-indicator.yaml + + 4 + + name + support.other.chomping-indicator.yaml + + 5 + + patterns + + + include + #comment + + + match + .+ + name + invalid.illegal.expected-comment-or-newline.yaml + + + + + end + ^(?=\S)|(?!\G) + patterns + + + begin + ^([ ]+)(?! ) + end + ^(?!\1|\s*$) + name + string.unquoted.block.yaml + + + + block-sequence + + match + (-)( |\t|$) + name + punctuation.definition.block.sequence.item.yaml + + comment + + begin + (?:(^[ \t]*)|[ \t]+)(?=#\p{Print}*$) + beginCaptures + + 1 + + name + punctuation.whitespace.comment.leading.yaml + + + end + (?!\G) + patterns + + + begin + # + beginCaptures + + 0 + + name + punctuation.definition.comment.yaml + + + end + \n + name + comment.line.number-sign.yaml + + + + directive + + begin + ^% + beginCaptures + + 0 + + name + punctuation.definition.directive.begin.yaml + + + end + (?=$|[ \t]+($|#)) + name + meta.directive.yaml + patterns + + + captures + + 1 + + name + keyword.other.directive.yaml.yaml + + 2 + + name + constant.numeric.yaml-version.yaml + + + match + \G(YAML)[ \t]+(\d+\.\d+) + + + captures + + 1 + + name + keyword.other.directive.tag.yaml + + 2 + + name + storage.type.tag-handle.yaml + + 3 + + name + support.type.tag-prefix.yaml + + + match + (?x) + \G + (TAG) + (?:[ \t]+ + ((?:!(?:[0-9A-Za-z\-]*!)?)) + (?:[ \t]+ ( + ! (?x: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )* + | (?![,!\[\]{}]) (?x: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ + ) + )? + )? + + + + captures + + 1 + + name + support.other.directive.reserved.yaml + + 2 + + name + string.unquoted.directive-name.yaml + + 3 + + name + string.unquoted.directive-parameter.yaml + + + match + (?x) \G (\w+) (?:[ \t]+ (\w+) (?:[ \t]+ (\w+))? )? + + + match + \S+ + name + invalid.illegal.unrecognized.yaml + + + + flow-alias + + captures + + 1 + + name + keyword.control.flow.alias.yaml + + 2 + + name + punctuation.definition.alias.yaml + + 3 + + name + variable.other.alias.yaml + + 4 + + name + invalid.illegal.character.anchor.yaml + + + match + ((\*))([^\s\[\]/{/},]+)([^\s\]},]\S*)? + + flow-collection + + patterns + + + include + #flow-sequence + + + include + #flow-mapping + + + + flow-mapping + + begin + \{ + beginCaptures + + 0 + + name + punctuation.definition.mapping.begin.yaml + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.mapping.end.yaml + + + name + meta.flow-mapping.yaml + patterns + + + include + #prototype + + + match + , + name + punctuation.separator.mapping.yaml + + + include + #flow-pair + + + + flow-node + + patterns + + + include + #prototype + + + include + #flow-alias + + + include + #flow-collection + + + include + #flow-scalar + + + + flow-pair + + patterns + + + begin + \? + beginCaptures + + 0 + + name + punctuation.definition.key-value.begin.yaml + + + end + (?=[},\]]) + name + meta.flow-pair.explicit.yaml + patterns + + + include + #prototype + + + include + #flow-pair + + + include + #flow-node + + + begin + :(?=\s|$|[\[\]{},]) + beginCaptures + + 0 + + name + punctuation.separator.key-value.mapping.yaml + + + end + (?=[},\]]) + patterns + + + include + #flow-value + + + + + + + begin + (?x) + (?= + (?: + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + ) + ( + [^\s:[\[\]{},]] + | : [^\s[\[\]{},]] + | \s+ (?![#\s]) + )* + \s* + : + (\s|$) + ) + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + meta.flow-pair.key.yaml + patterns + + + include + #flow-scalar-plain-in-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + + beginCaptures + + 0 + + name + entity.name.tag.yaml + + + contentName + entity.name.tag.yaml + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + string.unquoted.plain.in.yaml + + + + + include + #flow-node + + + begin + :(?=\s|$|[\[\]{},]) + captures + + 0 + + name + punctuation.separator.key-value.mapping.yaml + + + end + (?=[},\]]) + name + meta.flow-pair.yaml + patterns + + + include + #flow-value + + + + + + flow-scalar + + patterns + + + include + #flow-scalar-double-quoted + + + include + #flow-scalar-single-quoted + + + include + #flow-scalar-plain-in + + + + flow-scalar-double-quoted + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.yaml + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.yaml + + + name + string.quoted.double.yaml + patterns + + + match + \\([0abtnvfre "/\\N_Lp]|x\d\d|u\d{4}|U\d{8}) + name + constant.character.escape.yaml + + + match + \\\n + name + constant.character.escape.double-quoted.newline.yaml + + + + flow-scalar-plain-in + + patterns + + + include + #flow-scalar-plain-in-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + string.unquoted.plain.in.yaml + + + + flow-scalar-plain-in-implicit-type + + patterns + + + captures + + 1 + + name + constant.language.null.yaml + + 2 + + name + constant.language.boolean.yaml + + 3 + + name + constant.numeric.integer.yaml + + 4 + + name + constant.numeric.float.yaml + + 5 + + name + constant.other.timestamp.yaml + + 6 + + name + constant.language.value.yaml + + 7 + + name + constant.language.merge.yaml + + + match + (?x) + (?x: + (null|Null|NULL|~) + | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF) + | ( + (?: + [-+]? 0b [0-1_]+ # (base 2) + | [-+]? 0 [0-7_]+ # (base 8) + | [-+]? (?: 0|[1-9][0-9_]*) # (base 10) + | [-+]? 0x [0-9a-fA-F_]+ # (base 16) + | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60) + ) + ) + | ( + (?x: + [-+]? (?: [0-9] [0-9_]*)? \. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10) + | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \. [0-9_]* # (base 60) + | [-+]? \. (?: inf|Inf|INF) # (infinity) + | \. (?: nan|NaN|NAN) # (not a number) + ) + ) + | ( + (?x: + \d{4} - \d{2} - \d{2} # (y-m-d) + | \d{4} # (year) + - \d{1,2} # (month) + - \d{1,2} # (day) + (?: [Tt] | [ \t]+) \d{1,2} # (hour) + : \d{2} # (minute) + : \d{2} # (second) + (?: \.\d*)? # (fraction) + (?: + (?:[ \t]*) Z + | [-+] \d{1,2} (?: :\d{1,2})? + )? # (time zone) + ) + ) + | (=) + | (<<) + ) + (?: + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + ) + + + + + flow-scalar-plain-out + + patterns + + + include + #flow-scalar-plain-out-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + name + string.unquoted.plain.out.yaml + + + + flow-scalar-plain-out-implicit-type + + patterns + + + captures + + 1 + + name + constant.language.null.yaml + + 2 + + name + constant.language.boolean.yaml + + 3 + + name + constant.numeric.integer.yaml + + 4 + + name + constant.numeric.float.yaml + + 5 + + name + constant.other.timestamp.yaml + + 6 + + name + constant.language.value.yaml + + 7 + + name + constant.language.merge.yaml + + + match + (?x) + (?x: + (null|Null|NULL|~) + | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF) + | ( + (?: + [-+]? 0b [0-1_]+ # (base 2) + | [-+]? 0 [0-7_]+ # (base 8) + | [-+]? (?: 0|[1-9][0-9_]*) # (base 10) + | [-+]? 0x [0-9a-fA-F_]+ # (base 16) + | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60) + ) + ) + | ( + (?x: + [-+]? (?: [0-9] [0-9_]*)? \. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10) + | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \. [0-9_]* # (base 60) + | [-+]? \. (?: inf|Inf|INF) # (infinity) + | \. (?: nan|NaN|NAN) # (not a number) + ) + ) + | ( + (?x: + \d{4} - \d{2} - \d{2} # (y-m-d) + | \d{4} # (year) + - \d{1,2} # (month) + - \d{1,2} # (day) + (?: [Tt] | [ \t]+) \d{1,2} # (hour) + : \d{2} # (minute) + : \d{2} # (second) + (?: \.\d*)? # (fraction) + (?: + (?:[ \t]*) Z + | [-+] \d{1,2} (?: :\d{1,2})? + )? # (time zone) + ) + ) + | (=) + | (<<) + ) + (?x: + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + ) + + + + + flow-scalar-single-quoted + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.yaml + + + end + '(?!') + endCaptures + + 0 + + name + punctuation.definition.string.end.yaml + + + name + string.quoted.single.yaml + patterns + + + match + '' + name + constant.character.escape.single-quoted.yaml + + + + flow-sequence + + begin + \[ + beginCaptures + + 0 + + name + punctuation.definition.sequence.begin.yaml + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.sequence.end.yaml + + + name + meta.flow-sequence.yaml + patterns + + + include + #prototype + + + match + , + name + punctuation.separator.sequence.yaml + + + include + #flow-pair + + + include + #flow-node + + + + flow-value + + patterns + + + begin + \G(?![},\]]) + end + (?=[},\]]) + name + meta.flow-pair.value.yaml + patterns + + + include + #flow-node + + + + + + node + + patterns + + + include + #block-node + + + + property + + begin + (?=!|&) + end + (?!\G) + name + meta.property.yaml + patterns + + + captures + + 1 + + name + keyword.control.property.anchor.yaml + + 2 + + name + punctuation.definition.anchor.yaml + + 3 + + name + entity.name.type.anchor.yaml + + 4 + + name + invalid.illegal.character.anchor.yaml + + + match + \G((&))([^\s\[\]/{/},]+)(\S+)? + + + match + (?x) + \G + (?: + ! < (?: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ > + | (?:!(?:[0-9A-Za-z\-]*!)?) (?: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$_.~*'()] )+ + | ! + ) + (?=\ |\t|$) + + name + storage.type.tag-handle.yaml + + + match + \S+ + name + invalid.illegal.tag-handle.yaml + + + + prototype + + patterns + + + include + #comment + + + include + #property + + + + + scopeName + source.yaml + uuid + 686AD6AE-33F3-4493-9512-9E9FC1D5417F + + diff --git a/eclipse-language-servers/org.springframework.boot.ide.ls.integration.repository/category.xml b/eclipse-language-servers/org.springframework.tooling.ls.integration.repository/category.xml similarity index 58% rename from eclipse-language-servers/org.springframework.boot.ide.ls.integration.repository/category.xml rename to eclipse-language-servers/org.springframework.tooling.ls.integration.repository/category.xml index 0fc85994c..06cb7c1ca 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.ls.integration.repository/category.xml +++ b/eclipse-language-servers/org.springframework.tooling.ls.integration.repository/category.xml @@ -2,15 +2,27 @@ - + - + - + + + + + + + + + + + + + diff --git a/eclipse-language-servers/org.springframework.boot.ide.ls.integration.repository/pom.xml b/eclipse-language-servers/org.springframework.tooling.ls.integration.repository/pom.xml similarity index 97% rename from eclipse-language-servers/org.springframework.boot.ide.ls.integration.repository/pom.xml rename to eclipse-language-servers/org.springframework.tooling.ls.integration.repository/pom.xml index 9c60d86a7..fc3e433a7 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.ls.integration.repository/pom.xml +++ b/eclipse-language-servers/org.springframework.tooling.ls.integration.repository/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.springframework.boot.ide.ls.integration.repository + org.springframework.tooling.ls.integration.repository org.springframework.boot.ide diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls.feature/build.properties b/eclipse-language-servers/org.springframework.tooling.properties.ls.feature/build.properties new file mode 100644 index 000000000..64f93a9f0 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls.feature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls.feature/feature.xml b/eclipse-language-servers/org.springframework.tooling.properties.ls.feature/feature.xml new file mode 100644 index 000000000..5a6af9039 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls.feature/feature.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + diff --git a/eclipse-language-servers/org.springframework.boot.ide.java.servers.feature/pom.xml b/eclipse-language-servers/org.springframework.tooling.properties.ls.feature/pom.xml similarity index 89% rename from eclipse-language-servers/org.springframework.boot.ide.java.servers.feature/pom.xml rename to eclipse-language-servers/org.springframework.tooling.properties.ls.feature/pom.xml index e8c8474ff..792def247 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.java.servers.feature/pom.xml +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls.feature/pom.xml @@ -9,7 +9,7 @@ ../pom.xml - org.springframework.boot.ide.java.servers.feature + org.springframework.tooling.properties.ls.feature eclipse-feature diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls/.classpath b/eclipse-language-servers/org.springframework.tooling.properties.ls/.classpath new file mode 100644 index 000000000..eca7bdba8 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls/.project b/eclipse-language-servers/org.springframework.tooling.properties.ls/.project new file mode 100644 index 000000000..f455d5529 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/.project @@ -0,0 +1,28 @@ + + + org.springframework.tooling.properties.ls + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls/.settings/org.eclipse.jdt.core.prefs b/eclipse-language-servers/org.springframework.tooling.properties.ls/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..0c68a61dc --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls/META-INF/MANIFEST.MF b/eclipse-language-servers/org.springframework.tooling.properties.ls/META-INF/MANIFEST.MF new file mode 100644 index 000000000..68c3ead13 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Servers +Bundle-SymbolicName: org.springframework.tooling.properties.ls;singleton:=true +Bundle-Version: 4.0.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.9.0", + org.eclipse.core.runtime;bundle-version="3.12.0", + org.eclipse.lsp4e;bundle-version="0.1.0", + org.eclipse.ui.genericeditor;bundle-version="1.0.0", + org.eclipse.jface.text;bundle-version="3.11.100", + org.eclipse.jdt.ui;bundle-version="3.13.0", + org.eclipse.tm4e.core;bundle-version="0.1.0", + org.eclipse.tm4e.ui;bundle-version="0.1.0", + org.eclipse.lsp4j, + org.eclipse.ui.workbench, + org.eclipse.jface +Import-Package: com.google.gson;version="2.7.0", + org.eclipse.jface.preference, + org.eclipse.lsp4j.jsonrpc.messages;version="0.1.0.v20170117-0759", + org.eclipse.lsp4j.services;version="0.1.0.v20170117-0759", + org.osgi.framework diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls/build.properties b/eclipse-language-servers/org.springframework.tooling.properties.ls/build.properties new file mode 100644 index 000000000..8e982bda7 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + servers/,\ + syntaxes/ diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/plugin.xml b/eclipse-language-servers/org.springframework.tooling.properties.ls/plugin.xml similarity index 94% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/plugin.xml rename to eclipse-language-servers/org.springframework.tooling.properties.ls/plugin.xml index dd31f82b4..2715a02be 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/plugin.xml +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/plugin.xml @@ -51,7 +51,7 @@ @@ -79,7 +79,7 @@ diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/pom.xml b/eclipse-language-servers/org.springframework.tooling.properties.ls/pom.xml similarity index 94% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/pom.xml rename to eclipse-language-servers/org.springframework.tooling.properties.ls/pom.xml index a28fac71b..6f4d5c0db 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/pom.xml +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/pom.xml @@ -11,14 +11,14 @@ ../pom.xml - org.springframework.boot.ide.properties.servers + org.springframework.tooling.properties.ls eclipse-plugin org.springframework.ide.vscode boot-properties-language-server - 0.0.2-SNAPSHOT + 0.0.9-SNAPSHOT org.springframework.ide.eclipse diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/Constants.java b/eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/Constants.java new file mode 100644 index 000000000..cdc982205 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/Constants.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2016, 2017 Pivotal, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Pivotal, Inc. - initial API and implementation + *******************************************************************************/ +package org.springframework.tooling.properties.ls; + +/** + * @author Martin Lippert + */ +public class Constants { + + public static final String PLUGIN_ID = "org.springframework.tooling.properties.ls"; + public static final String LANGUAGE_SERVER_VERSION = "0.0.9"; + +} diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringBootPropertiesLanguageServer.java b/eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/SpringBootPropertiesLanguageServer.java similarity index 98% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringBootPropertiesLanguageServer.java rename to eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/SpringBootPropertiesLanguageServer.java index 749f6015f..3912695c6 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringBootPropertiesLanguageServer.java +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/SpringBootPropertiesLanguageServer.java @@ -8,7 +8,7 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.properties.servers; +package org.springframework.tooling.properties.ls; import java.io.File; import java.io.InputStream; diff --git a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringPropertiesPresentationReconciler.java b/eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/SpringPropertiesPresentationReconciler.java similarity index 97% rename from eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringPropertiesPresentationReconciler.java rename to eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/SpringPropertiesPresentationReconciler.java index 6cfdffd15..db53c505f 100644 --- a/eclipse-language-servers/org.springframework.boot.ide.properties.servers/src/org/springframework/boot/ide/properties/servers/SpringPropertiesPresentationReconciler.java +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/src/org/springframework/tooling/properties/ls/SpringPropertiesPresentationReconciler.java @@ -8,7 +8,7 @@ * Contributors: * Pivotal, Inc. - initial API and implementation *******************************************************************************/ -package org.springframework.boot.ide.properties.servers; +package org.springframework.tooling.properties.ls; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions; diff --git a/eclipse-language-servers/org.springframework.tooling.properties.ls/syntaxes/YAML.tmLanguage b/eclipse-language-servers/org.springframework.tooling.properties.ls/syntaxes/YAML.tmLanguage new file mode 100644 index 000000000..efc4c8ab0 --- /dev/null +++ b/eclipse-language-servers/org.springframework.tooling.properties.ls/syntaxes/YAML.tmLanguage @@ -0,0 +1,1164 @@ + + + + + fileTypes + + yaml + yml + rviz + reek + clang-format + yaml-tmlanguage + syntax + sublime-syntax + + firstLineMatch + ^%YAML( ?1.\d+)? + keyEquivalent + ^~Y + name + YAML + patterns + + + include + #comment + + + include + #property + + + include + #directive + + + match + ^--- + name + entity.other.document.begin.yaml + + + match + ^\.{3} + name + entity.other.document.end.yaml + + + include + #node + + + repository + + block-collection + + patterns + + + include + #block-sequence + + + include + #block-mapping + + + + block-mapping + + patterns + + + include + #block-pair + + + + block-node + + patterns + + + include + #prototype + + + include + #block-scalar + + + include + #block-collection + + + include + #flow-scalar-plain-out + + + include + #flow-node + + + + block-pair + + patterns + + + begin + \? + beginCaptures + + 1 + + name + punctuation.definition.key-value.begin.yaml + + + end + (?=\?)|^ *(:)|(:) + endCaptures + + 1 + + name + punctuation.separator.key-value.mapping.yaml + + 2 + + name + invalid.illegal.expected-newline.yaml + + + name + meta.block-mapping.yaml + patterns + + + include + #block-node + + + + + begin + (?x) + (?= + (?x: + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + ) + ( + [^\s:] + | : \S + | \s+ (?![#\s]) + )* + \s* + : + (\s|$) + ) + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + patterns + + + include + #flow-scalar-plain-out-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + + beginCaptures + + 0 + + name + entity.name.tag.yaml + + + contentName + entity.name.tag.yaml + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + name + string.unquoted.plain.out.yaml + + + + + match + :(?=\s|$) + name + punctuation.separator.key-value.mapping.yaml + + + + block-scalar + + begin + (?:(\|)|(>))([1-9])?([-+])?(.*\n?) + beginCaptures + + 1 + + name + punctuation.definition.block.scalar.literal.yaml + + 2 + + name + punctuation.definition.block.scalar.folded.yaml + + 3 + + name + constant.numeric.indentation-indicator.yaml + + 4 + + name + support.other.chomping-indicator.yaml + + 5 + + patterns + + + include + #comment + + + match + .+ + name + invalid.illegal.expected-comment-or-newline.yaml + + + + + end + ^(?=\S)|(?!\G) + patterns + + + begin + ^([ ]+)(?! ) + end + ^(?!\1|\s*$) + name + string.unquoted.block.yaml + + + + block-sequence + + match + (-)( |\t|$) + name + punctuation.definition.block.sequence.item.yaml + + comment + + begin + (?:(^[ \t]*)|[ \t]+)(?=#\p{Print}*$) + beginCaptures + + 1 + + name + punctuation.whitespace.comment.leading.yaml + + + end + (?!\G) + patterns + + + begin + # + beginCaptures + + 0 + + name + punctuation.definition.comment.yaml + + + end + \n + name + comment.line.number-sign.yaml + + + + directive + + begin + ^% + beginCaptures + + 0 + + name + punctuation.definition.directive.begin.yaml + + + end + (?=$|[ \t]+($|#)) + name + meta.directive.yaml + patterns + + + captures + + 1 + + name + keyword.other.directive.yaml.yaml + + 2 + + name + constant.numeric.yaml-version.yaml + + + match + \G(YAML)[ \t]+(\d+\.\d+) + + + captures + + 1 + + name + keyword.other.directive.tag.yaml + + 2 + + name + storage.type.tag-handle.yaml + + 3 + + name + support.type.tag-prefix.yaml + + + match + (?x) + \G + (TAG) + (?:[ \t]+ + ((?:!(?:[0-9A-Za-z\-]*!)?)) + (?:[ \t]+ ( + ! (?x: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )* + | (?![,!\[\]{}]) (?x: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ + ) + )? + )? + + + + captures + + 1 + + name + support.other.directive.reserved.yaml + + 2 + + name + string.unquoted.directive-name.yaml + + 3 + + name + string.unquoted.directive-parameter.yaml + + + match + (?x) \G (\w+) (?:[ \t]+ (\w+) (?:[ \t]+ (\w+))? )? + + + match + \S+ + name + invalid.illegal.unrecognized.yaml + + + + flow-alias + + captures + + 1 + + name + keyword.control.flow.alias.yaml + + 2 + + name + punctuation.definition.alias.yaml + + 3 + + name + variable.other.alias.yaml + + 4 + + name + invalid.illegal.character.anchor.yaml + + + match + ((\*))([^\s\[\]/{/},]+)([^\s\]},]\S*)? + + flow-collection + + patterns + + + include + #flow-sequence + + + include + #flow-mapping + + + + flow-mapping + + begin + \{ + beginCaptures + + 0 + + name + punctuation.definition.mapping.begin.yaml + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.mapping.end.yaml + + + name + meta.flow-mapping.yaml + patterns + + + include + #prototype + + + match + , + name + punctuation.separator.mapping.yaml + + + include + #flow-pair + + + + flow-node + + patterns + + + include + #prototype + + + include + #flow-alias + + + include + #flow-collection + + + include + #flow-scalar + + + + flow-pair + + patterns + + + begin + \? + beginCaptures + + 0 + + name + punctuation.definition.key-value.begin.yaml + + + end + (?=[},\]]) + name + meta.flow-pair.explicit.yaml + patterns + + + include + #prototype + + + include + #flow-pair + + + include + #flow-node + + + begin + :(?=\s|$|[\[\]{},]) + beginCaptures + + 0 + + name + punctuation.separator.key-value.mapping.yaml + + + end + (?=[},\]]) + patterns + + + include + #flow-value + + + + + + + begin + (?x) + (?= + (?: + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + ) + ( + [^\s:[\[\]{},]] + | : [^\s[\[\]{},]] + | \s+ (?![#\s]) + )* + \s* + : + (\s|$) + ) + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + meta.flow-pair.key.yaml + patterns + + + include + #flow-scalar-plain-in-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + + beginCaptures + + 0 + + name + entity.name.tag.yaml + + + contentName + entity.name.tag.yaml + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + string.unquoted.plain.in.yaml + + + + + include + #flow-node + + + begin + :(?=\s|$|[\[\]{},]) + captures + + 0 + + name + punctuation.separator.key-value.mapping.yaml + + + end + (?=[},\]]) + name + meta.flow-pair.yaml + patterns + + + include + #flow-value + + + + + + flow-scalar + + patterns + + + include + #flow-scalar-double-quoted + + + include + #flow-scalar-single-quoted + + + include + #flow-scalar-plain-in + + + + flow-scalar-double-quoted + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.yaml + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.yaml + + + name + string.quoted.double.yaml + patterns + + + match + \\([0abtnvfre "/\\N_Lp]|x\d\d|u\d{4}|U\d{8}) + name + constant.character.escape.yaml + + + match + \\\n + name + constant.character.escape.double-quoted.newline.yaml + + + + flow-scalar-plain-in + + patterns + + + include + #flow-scalar-plain-in-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + string.unquoted.plain.in.yaml + + + + flow-scalar-plain-in-implicit-type + + patterns + + + captures + + 1 + + name + constant.language.null.yaml + + 2 + + name + constant.language.boolean.yaml + + 3 + + name + constant.numeric.integer.yaml + + 4 + + name + constant.numeric.float.yaml + + 5 + + name + constant.other.timestamp.yaml + + 6 + + name + constant.language.value.yaml + + 7 + + name + constant.language.merge.yaml + + + match + (?x) + (?x: + (null|Null|NULL|~) + | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF) + | ( + (?: + [-+]? 0b [0-1_]+ # (base 2) + | [-+]? 0 [0-7_]+ # (base 8) + | [-+]? (?: 0|[1-9][0-9_]*) # (base 10) + | [-+]? 0x [0-9a-fA-F_]+ # (base 16) + | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60) + ) + ) + | ( + (?x: + [-+]? (?: [0-9] [0-9_]*)? \. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10) + | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \. [0-9_]* # (base 60) + | [-+]? \. (?: inf|Inf|INF) # (infinity) + | \. (?: nan|NaN|NAN) # (not a number) + ) + ) + | ( + (?x: + \d{4} - \d{2} - \d{2} # (y-m-d) + | \d{4} # (year) + - \d{1,2} # (month) + - \d{1,2} # (day) + (?: [Tt] | [ \t]+) \d{1,2} # (hour) + : \d{2} # (minute) + : \d{2} # (second) + (?: \.\d*)? # (fraction) + (?: + (?:[ \t]*) Z + | [-+] \d{1,2} (?: :\d{1,2})? + )? # (time zone) + ) + ) + | (=) + | (<<) + ) + (?: + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + ) + + + + + flow-scalar-plain-out + + patterns + + + include + #flow-scalar-plain-out-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + name + string.unquoted.plain.out.yaml + + + + flow-scalar-plain-out-implicit-type + + patterns + + + captures + + 1 + + name + constant.language.null.yaml + + 2 + + name + constant.language.boolean.yaml + + 3 + + name + constant.numeric.integer.yaml + + 4 + + name + constant.numeric.float.yaml + + 5 + + name + constant.other.timestamp.yaml + + 6 + + name + constant.language.value.yaml + + 7 + + name + constant.language.merge.yaml + + + match + (?x) + (?x: + (null|Null|NULL|~) + | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF) + | ( + (?: + [-+]? 0b [0-1_]+ # (base 2) + | [-+]? 0 [0-7_]+ # (base 8) + | [-+]? (?: 0|[1-9][0-9_]*) # (base 10) + | [-+]? 0x [0-9a-fA-F_]+ # (base 16) + | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60) + ) + ) + | ( + (?x: + [-+]? (?: [0-9] [0-9_]*)? \. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10) + | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \. [0-9_]* # (base 60) + | [-+]? \. (?: inf|Inf|INF) # (infinity) + | \. (?: nan|NaN|NAN) # (not a number) + ) + ) + | ( + (?x: + \d{4} - \d{2} - \d{2} # (y-m-d) + | \d{4} # (year) + - \d{1,2} # (month) + - \d{1,2} # (day) + (?: [Tt] | [ \t]+) \d{1,2} # (hour) + : \d{2} # (minute) + : \d{2} # (second) + (?: \.\d*)? # (fraction) + (?: + (?:[ \t]*) Z + | [-+] \d{1,2} (?: :\d{1,2})? + )? # (time zone) + ) + ) + | (=) + | (<<) + ) + (?x: + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + ) + + + + + flow-scalar-single-quoted + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.yaml + + + end + '(?!') + endCaptures + + 0 + + name + punctuation.definition.string.end.yaml + + + name + string.quoted.single.yaml + patterns + + + match + '' + name + constant.character.escape.single-quoted.yaml + + + + flow-sequence + + begin + \[ + beginCaptures + + 0 + + name + punctuation.definition.sequence.begin.yaml + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.sequence.end.yaml + + + name + meta.flow-sequence.yaml + patterns + + + include + #prototype + + + match + , + name + punctuation.separator.sequence.yaml + + + include + #flow-pair + + + include + #flow-node + + + + flow-value + + patterns + + + begin + \G(?![},\]]) + end + (?=[},\]]) + name + meta.flow-pair.value.yaml + patterns + + + include + #flow-node + + + + + + node + + patterns + + + include + #block-node + + + + property + + begin + (?=!|&) + end + (?!\G) + name + meta.property.yaml + patterns + + + captures + + 1 + + name + keyword.control.property.anchor.yaml + + 2 + + name + punctuation.definition.anchor.yaml + + 3 + + name + entity.name.type.anchor.yaml + + 4 + + name + invalid.illegal.character.anchor.yaml + + + match + \G((&))([^\s\[\]/{/},]+)(\S+)? + + + match + (?x) + \G + (?: + ! < (?: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ > + | (?:!(?:[0-9A-Za-z\-]*!)?) (?: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$_.~*'()] )+ + | ! + ) + (?=\ |\t|$) + + name + storage.type.tag-handle.yaml + + + match + \S+ + name + invalid.illegal.tag-handle.yaml + + + + prototype + + patterns + + + include + #comment + + + include + #property + + + + + scopeName + source.yaml + uuid + 686AD6AE-33F3-4493-9512-9E9FC1D5417F + + diff --git a/eclipse-language-servers/pom.xml b/eclipse-language-servers/pom.xml index 538ac7bfc..824fb07c1 100644 --- a/eclipse-language-servers/pom.xml +++ b/eclipse-language-servers/pom.xml @@ -27,17 +27,27 @@ - org.springframework.boot.ide.properties.servers - org.springframework.boot.ide.properties.servers.feature - org.springframework.boot.ide.java.servers - org.springframework.boot.ide.java.servers.feature - org.springframework.boot.ide.cloudfoundry.manifest.integration - org.springframework.boot.ide.cloudfoundry.manifest.integration.feature - org.springframework.boot.ide.ls.integration.repository - org.springframework.tooling.cloudfoundry.manifest.ls org.springframework.tooling.cloudfoundry.manifest.ls.feature org.springframework.tooling.ls.repository + + org.springframework.tooling.cloudfoundry.manifest.ls.integration + org.springframework.tooling.cloudfoundry.manifest.ls.integration.feature + + org.springframework.tooling.properties.ls + org.springframework.tooling.properties.ls.feature + + org.springframework.tooling.boot.java.ls + org.springframework.tooling.boot.java.ls.feature + + org.springframework.tooling.bosh.ls + org.springframework.tooling.bosh.ls.feature + + org.springframework.tooling.concourse.ls + org.springframework.tooling.concourse.ls.feature + + org.springframework.tooling.ls.integration.repository +