Merge branch 'master' into jdt-classpath
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bosh-yaml",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"description": "Provides validation and content assist for various Bosh configuration files",
|
||||
"repository": "https://github.com/spring-projects/atom-bosh",
|
||||
"icon": "icon.png",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cf-manifest-yaml",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"description": "Cloud Foundry Deployment Manifest YAML support for Atom",
|
||||
"repository": "https://github.com/spring-projects/atom-cf-manifest-yaml",
|
||||
"icon": "icon.png",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "concourse-pipeline-yaml",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"description": "Provides validation and content assist for Concourse CI pipeline and task configuration yml files",
|
||||
"repository": "https://github.com/spring-projects/atom-concourse",
|
||||
"icon": "icon.png",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "spring-boot",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"description": "Spring Boot support for Atom",
|
||||
"repository": "https://github.com/spring-projects/atom-spring-boot",
|
||||
"icon": "icon.png",
|
||||
|
||||
@@ -538,6 +538,18 @@ jobs:
|
||||
trigger: true
|
||||
passed:
|
||||
- tag-atom-release
|
||||
- get: atom-bosh
|
||||
trigger: true
|
||||
passed:
|
||||
- tag-atom-release
|
||||
- get: atom-cf-manifest-yaml
|
||||
trigger: true
|
||||
passed:
|
||||
- tag-atom-release
|
||||
- get: atom-spring-boot
|
||||
trigger: true
|
||||
passed:
|
||||
- tag-atom-release
|
||||
- task: publish-atom-releases
|
||||
file: sts4/concourse/tasks/publish-atom-releases.yml
|
||||
params:
|
||||
@@ -555,6 +567,9 @@ jobs:
|
||||
STS 4 Atom Extensions released
|
||||
Releases now available on Atom Marketplace:
|
||||
• <https://atom.io/packages/concourse-pipeline-yaml|Concourse CI Pipeline Editor>
|
||||
• <https://atom.io/packages/bosh-yaml|Bosh YAML Editor>
|
||||
• <https://atom.io/packages/cf-manifest-yaml|CF Manifest YAML Editor>
|
||||
• <https://atom.io/packages/spring-boot|Spring Boot Support>
|
||||
- name: build-concourse-rc
|
||||
plan:
|
||||
- aggregate:
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
inputs:
|
||||
- name: sts4
|
||||
- name: atom-concourse
|
||||
- name: atom-bosh
|
||||
- name: atom-cf-manifest-yaml
|
||||
- name: atom-spring-boot
|
||||
params:
|
||||
atom_token: atom_token_must_be_provided!!!
|
||||
platform: linux
|
||||
|
||||
@@ -104,10 +104,10 @@
|
||||
<profile>
|
||||
<id>e47</id>
|
||||
<properties>
|
||||
<dist.target>e4.7.2</dist.target>
|
||||
<dist.target>e4.7.3</dist.target>
|
||||
<dist.target.major>e4.7</dist.target.major>
|
||||
<dist.platform.name>Oxygen</dist.platform.name>
|
||||
<dist.platform.name.long>Oxygen.2 (4.7.2)</dist.platform.name.long>
|
||||
<dist.platform.name.long>Oxygen.3 (4.7.3)</dist.platform.name.long>
|
||||
<dist.platform.id>oxygen</dist.platform.id>
|
||||
<dist.platform.version>4.7</dist.platform.version>
|
||||
<package.qualifierPrefix>e47</package.qualifierPrefix>
|
||||
@@ -141,7 +141,7 @@
|
||||
<repository>
|
||||
<id>orbit</id>
|
||||
<layout>p2</layout>
|
||||
<url>http://download.eclipse.org/tools/orbit/downloads/drops/R20170919201930/repository/</url>
|
||||
<url>http://download.eclipse.org/tools/orbit/downloads/drops/R20180206163158/repository/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>latest-buildship-release</id>
|
||||
@@ -222,16 +222,16 @@
|
||||
<layout>p2</layout>
|
||||
<url>http://download.eclipse.org/eclipse/updates/4.8-I-builds/</url>
|
||||
</repository>
|
||||
<!-- <repository>
|
||||
<repository>
|
||||
<id>orbit</id>
|
||||
<layout>p2</layout>
|
||||
<url>http://download.eclipse.org/tools/orbit/downloads/drops/S20171130170529/repository/</url>
|
||||
</repository> -->
|
||||
<repository>
|
||||
<url>http://download.eclipse.org/tools/orbit/downloads/drops/S20180302171354/repository/</url>
|
||||
</repository>
|
||||
<!-- <repository>
|
||||
<id>orbit-i-builds</id>
|
||||
<layout>p2</layout>
|
||||
<url>http://download.eclipse.org/tools/orbit/downloads/latest-I/</url>
|
||||
</repository>
|
||||
</repository> -->
|
||||
<repository>
|
||||
<id>latest-m2e</id>
|
||||
<layout>p2</layout>
|
||||
|
||||
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Spring Boot Language Server
|
||||
Bundle-Vendor: Pivotal, Inc.
|
||||
Bundle-SymbolicName: org.springframework.tooling.boot.ls;singleton:=true
|
||||
Bundle-Version: 0.1.6.qualifier
|
||||
Bundle-Version: 0.2.1.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",
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>org.springframework.tooling.boot.ls</artifactId>
|
||||
<version>0.1.6-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>spring-boot-language-server</artifactId>
|
||||
<version>0.1.6-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ package org.springframework.tooling.boot.ls;
|
||||
public class Constants {
|
||||
|
||||
public static final String PLUGIN_ID = "org.springframework.tooling.boot.ls";
|
||||
public static final String LANGUAGE_SERVER_VERSION = "0.1.6-SNAPSHOT.jar";
|
||||
public static final String LANGUAGE_SERVER_VERSION = "0.2.1-SNAPSHOT.jar";
|
||||
|
||||
public static final String PREF_BOOT_HINTS = "boot-java.boot-hints.on";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Name: BOSH Manifest Language Server
|
||||
Bundle-Vendor: Pivotal, Inc.
|
||||
Bundle-SymbolicName: org.springframework.tooling.bosh.ls;singleton:=true
|
||||
Bundle-Version: 0.1.6.qualifier
|
||||
Bundle-Version: 0.2.1.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",
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>org.springframework.tooling.bosh.ls</artifactId>
|
||||
<version>0.1.6-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>bosh-language-server</artifactId>
|
||||
<version>0.1.6-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.ide.eclipse</groupId>
|
||||
|
||||
@@ -16,6 +16,6 @@ package org.springframework.tooling.bosh.ls;
|
||||
public class Constants {
|
||||
|
||||
public static final String PLUGIN_ID = "org.springframework.tooling.bosh.ls";
|
||||
public static final String LANGUAGE_SERVER_VERSION = "0.1.6-SNAPSHOT";
|
||||
public static final String LANGUAGE_SERVER_VERSION = "0.2.1-SNAPSHOT";
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Cloud Foundry Manifest Language Server
|
||||
Bundle-Vendor: Pivotal, Inc.
|
||||
Bundle-SymbolicName: org.springframework.tooling.cloudfoundry.manifest.ls;singleton:=true
|
||||
Bundle-Version: 0.1.6.qualifier
|
||||
Bundle-Version: 0.2.1.qualifier
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.8.0",
|
||||
org.eclipse.core.runtime;bundle-version="3.12.0",
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>org.springframework.tooling.cloudfoundry.manifest.ls</artifactId>
|
||||
<version>0.1.6-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>manifest-yaml-language-server</artifactId>
|
||||
<version>0.1.6-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@ package org.springframework.tooling.cloudfoundry.manifest.ls;
|
||||
public class Constants {
|
||||
|
||||
public static final String PLUGIN_ID = "org.springframework.tooling.cloudfoundry.manifest.ls";
|
||||
public static final String LANGUAGE_SERVER_VERSION = "0.1.6-SNAPSHOT.jar";
|
||||
public static final String LANGUAGE_SERVER_VERSION = "0.2.1-SNAPSHOT.jar";
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Concourse Pipeline Language Server
|
||||
Bundle-Vendor: Pivotal, Inc.
|
||||
Bundle-SymbolicName: org.springframework.tooling.concourse.ls;singleton:=true
|
||||
Bundle-Version: 0.1.6.qualifier
|
||||
Bundle-Version: 0.2.1.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",
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>org.springframework.tooling.concourse.ls</artifactId>
|
||||
<version>0.1.6-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>concourse-language-server</artifactId>
|
||||
<version>0.1.6-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.ide.eclipse</groupId>
|
||||
|
||||
@@ -16,6 +16,6 @@ package org.springframework.tooling.concourse.ls;
|
||||
public class Constants {
|
||||
|
||||
public static final String PLUGIN_ID = "org.springframework.tooling.concourse.ls";
|
||||
public static final String LANGUAGE_SERVER_VERSION = "0.1.6-SNAPSHOT";
|
||||
public static final String LANGUAGE_SERVER_VERSION = "0.2.1-SNAPSHOT";
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../commons/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@ public class BoshCliConfig {
|
||||
private Settings settings = new Settings(null);
|
||||
|
||||
public String getCommand() {
|
||||
return (String) settings.getProperty("bosh", "cli", "command");
|
||||
return settings.getString("bosh", "cli", "command");
|
||||
}
|
||||
public String getTarget() {
|
||||
return (String) settings.getProperty("bosh", "cli", "target");
|
||||
return settings.getString("bosh", "cli", "target");
|
||||
}
|
||||
public Duration getTimeout() {
|
||||
Integer seconds = (Integer) settings.getProperty("cli", "timeout");
|
||||
Integer seconds = settings.getInt("cli", "timeout");
|
||||
return seconds == null ? Duration.ofSeconds(3) : Duration.ofSeconds(seconds);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ import org.springframework.ide.vscode.commons.yaml.schema.DynamicSchemaContext;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
public class BoshCommandStemcellsProviderTest {
|
||||
|
||||
@@ -83,12 +85,12 @@ public class BoshCommandStemcellsProviderTest {
|
||||
// }
|
||||
|
||||
@Test public void obeysCliConfigCommandAndTarget() throws Exception {
|
||||
Map<String, Object> settings = ImmutableMap.of("bosh", ImmutableMap.of("cli",
|
||||
JsonElement settings = settings(ImmutableMap.of("bosh", ImmutableMap.of("cli",
|
||||
ImmutableMap.of(
|
||||
"command", "alternate-command",
|
||||
"target", "some-target"
|
||||
)
|
||||
));
|
||||
)));
|
||||
cliConfig.handleConfigurationChange(new Settings(settings));
|
||||
assertEquals(ImmutableList.of(
|
||||
new StemcellData("bosh-vsphere-esxi-centos-7-go_agent", "3421.11", "centos-7"),
|
||||
@@ -100,12 +102,12 @@ public class BoshCommandStemcellsProviderTest {
|
||||
}
|
||||
|
||||
@Test public void obeysCliConfigTarget() throws Exception {
|
||||
Map<String, Object> settings = ImmutableMap.of("bosh", ImmutableMap.of("cli",
|
||||
JsonElement settings = settings(ImmutableMap.of("bosh", ImmutableMap.of("cli",
|
||||
ImmutableMap.of(
|
||||
"command", "alternate-command",
|
||||
"target", "explicit-target"
|
||||
)
|
||||
));
|
||||
)));
|
||||
cliConfig.handleConfigurationChange(new Settings(settings));
|
||||
assertEquals(ImmutableList.of(
|
||||
new StemcellData("bosh-vsphere-esxi-centos-7-go_agent", "3421.11", "centos-7"),
|
||||
@@ -116,4 +118,8 @@ public class BoshCommandStemcellsProviderTest {
|
||||
verify(provider).executeCommand(eq(new ExternalCommand("alternate-command", "-e", "explicit-target", "stemcells", "--json")));
|
||||
}
|
||||
|
||||
private JsonElement settings(Object configObject) {
|
||||
Gson gson = new Gson();
|
||||
return gson.toJsonTree(configObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -10,7 +10,11 @@
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.vscode.commons.languageserver.util;
|
||||
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
/**
|
||||
* Convenience wrapper around a 'settings' object. Provides some useful accessor methods to
|
||||
@@ -18,31 +22,60 @@ import java.util.Map;
|
||||
*/
|
||||
public class Settings {
|
||||
|
||||
private Object settings;
|
||||
private static final Logger log = LoggerFactory.getLogger(Settings.class);
|
||||
|
||||
public Settings(Object settings) {
|
||||
private JsonElement settings;
|
||||
|
||||
public Settings(JsonElement settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
public Integer getInt(String... names) {
|
||||
Object val = getProperty(names);
|
||||
if (val instanceof Number) {
|
||||
return ((Number) val).intValue();
|
||||
try {
|
||||
JsonElement val = getRawProperty(names);
|
||||
if (val != null) {
|
||||
return val.getAsInt();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object getProperty(String... names) {
|
||||
return getProperty(settings, names, 0);
|
||||
public String getString(String... names) {
|
||||
try {
|
||||
JsonElement val = getRawProperty(names);
|
||||
if (val != null) {
|
||||
return val.getAsString();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static Object getProperty(Object settings, String[] names, int i) {
|
||||
public Boolean getBoolean(String... names) {
|
||||
try {
|
||||
JsonElement val = getRawProperty(names);
|
||||
if (val != null) {
|
||||
return val.getAsBoolean();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public JsonElement getRawProperty(String... names) {
|
||||
return getRawProperty(settings, names, 0);
|
||||
}
|
||||
|
||||
private static JsonElement getRawProperty(JsonElement settings, String[] names, int i) {
|
||||
if (i >= names.length) {
|
||||
return settings;
|
||||
} else if (settings instanceof Map) {
|
||||
Object sub = ((Map)settings).get(names[i]);
|
||||
return getProperty(sub, names, i+1);
|
||||
} else if (settings instanceof JsonObject) {
|
||||
JsonElement sub = ((JsonObject)settings).get(names[i]);
|
||||
return getRawProperty(sub, names, i+1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -52,4 +85,5 @@ public class Settings {
|
||||
public String toString() {
|
||||
return settings.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.ide.vscode.commons.util.FileObserver;
|
||||
import org.springframework.ide.vscode.commons.util.Log;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
public class SimpleWorkspaceService implements WorkspaceService {
|
||||
|
||||
@@ -71,7 +72,7 @@ public class SimpleWorkspaceService implements WorkspaceService {
|
||||
|
||||
@Override
|
||||
public void didChangeConfiguration(DidChangeConfigurationParams params) {
|
||||
configurationListeners.fire(new Settings(params.getSettings()));
|
||||
configurationListeners.fire(new Settings((JsonElement) params.getSettings()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<name>commons-parent</name>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../commons/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../commons/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.ide.vscode.commons.cloudfoundry.client.ClientTimeouts;
|
||||
import org.springframework.ide.vscode.commons.cloudfoundry.client.CloudFoundryClientFactory;
|
||||
import org.springframework.ide.vscode.commons.cloudfoundry.client.cftarget.CFClientParams;
|
||||
@@ -35,6 +37,7 @@ import org.springframework.ide.vscode.commons.languageserver.hover.HoverInfoProv
|
||||
import org.springframework.ide.vscode.commons.languageserver.hover.VscodeHoverEngineAdapter;
|
||||
import org.springframework.ide.vscode.commons.languageserver.reconcile.IReconcileEngine;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.HoverHandler;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.Settings;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleWorkspaceService;
|
||||
@@ -57,6 +60,9 @@ import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
|
||||
public class ManifestYamlLanguageServer extends SimpleLanguageServer {
|
||||
|
||||
@@ -65,9 +71,11 @@ public class ManifestYamlLanguageServer extends SimpleLanguageServer {
|
||||
private CFTargetCache cfTargetCache;
|
||||
private final CloudFoundryClientFactory cfClientFactory;
|
||||
private final CfClientConfig cfClientConfig;
|
||||
private final Logger log = LoggerFactory.getLogger(ManifestYamlLanguageServer.class);
|
||||
|
||||
private final ImmutableSet<LanguageId> FALLBACK_YML_IDS = ImmutableSet.of(LanguageId.of("yml"), LanguageId.of("yaml"));
|
||||
final private ClientParamsProvider defaultClientParamsProvider;
|
||||
private Gson gson = new Gson();
|
||||
|
||||
public ManifestYamlLanguageServer() {
|
||||
this(DefaultCloudFoundryClientFactoryV2.INSTANCE, CfCliParamsProvider.getInstance());
|
||||
@@ -128,9 +136,10 @@ public class ManifestYamlLanguageServer extends SimpleLanguageServer {
|
||||
documents.onHover(hoverEngine);
|
||||
|
||||
workspace.onDidChangeConfiguraton(settings -> {
|
||||
Object cfClientParamsObj = settings.getProperty("cfClientParams");
|
||||
if (cfClientParamsObj instanceof Map<?,?>) {
|
||||
applyCfLoginParameterSettings((Map<?,?>) cfClientParamsObj);
|
||||
//TODO code below needs to convert to a "nicer" Java representation of the CF client params, than just a Map with nested structures
|
||||
Map<?, ?> asMap = getAs(Map.class, settings, "cfClientParams");
|
||||
if (asMap != null) {
|
||||
applyCfLoginParameterSettings(asMap);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -139,6 +148,18 @@ public class ManifestYamlLanguageServer extends SimpleLanguageServer {
|
||||
return cfClientConfig;
|
||||
}
|
||||
|
||||
protected <T> T getAs(Class<T> klass, Settings settings, String... names) {
|
||||
try {
|
||||
JsonElement data = settings.getRawProperty(names);
|
||||
if (data != null) {
|
||||
return gson.fromJson(data, klass);
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void applyCfLoginParameterSettings(Map<?, ?> cfClientParamsData) {
|
||||
if (cfClientParamsData.get("parameters") instanceof List<?>) {
|
||||
|
||||
@@ -15,10 +15,10 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.lsp4j.DidChangeConfigurationParams;
|
||||
import org.eclipse.lsp4j.InitializeResult;
|
||||
@@ -27,7 +27,10 @@ import org.junit.Test;
|
||||
import org.springframework.ide.vscode.commons.util.text.LanguageId;
|
||||
import org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
|
||||
public class ManifestYamlLanguageServerTest {
|
||||
|
||||
@@ -100,7 +103,11 @@ public class ManifestYamlLanguageServerTest {
|
||||
assertEquals(Arrays.asList("test.io"), manifestYamlLanguageServer.getCfTargets());
|
||||
|
||||
DidChangeConfigurationParams params = new DidChangeConfigurationParams();
|
||||
params.setSettings(new ObjectMapper().readValue(getClass().getResourceAsStream("/cf-targets1.json"), Map.class));
|
||||
|
||||
JsonParser parser = new JsonParser();
|
||||
params.setSettings(parser.parse(new InputStreamReader(getClass().getResourceAsStream("/cf-targets1.json")))
|
||||
);
|
||||
|
||||
manifestYamlLanguageServer.getWorkspaceService().didChangeConfiguration(params);
|
||||
assertEquals(3, manifestYamlLanguageServer.getCfClientConfig().getClientParamsProvider().getParams().size());
|
||||
assertEquals(Arrays.asList("test.io", "api.system.demo-gcp.springapps.io", "api.run.pivotal.io"), manifestYamlLanguageServer.getCfTargets());
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.ide.vscode</groupId>
|
||||
<artifactId>commons-parent</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
<version>0.2.1-SNAPSHOT</version>
|
||||
<relativePath>../commons/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -61,6 +61,11 @@
|
||||
<artifactId>commons-boot-app-cli</artifactId>
|
||||
<version>${dependencies.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>org.eclipse.jdt.core</artifactId>
|
||||
<version>3.13.102.v20180320-1701_BETA_JAVA10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jdt</groupId>
|
||||
<artifactId>org.eclipse.jdt.core</artifactId>
|
||||
|
||||
@@ -24,7 +24,7 @@ public class BootJavaConfig {
|
||||
private Settings settings = new Settings(null);
|
||||
|
||||
public boolean isBootHintsEnabled() {
|
||||
Boolean enabled = (Boolean) settings.getProperty("boot-java", "boot-hints", "on");
|
||||
Boolean enabled = settings.getBoolean("boot-java", "boot-hints", "on");
|
||||
return enabled == null || enabled.booleanValue();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ package org.springframework.ide.vscode.boot.java.handlers;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
@@ -71,9 +70,9 @@ public class BootJavaReferencesHandler implements ReferencesHandler {
|
||||
}
|
||||
|
||||
private List<? extends Location> provideReferences(TextDocument document, int offset) throws Exception {
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS9);
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS10);
|
||||
Map<String, String> options = JavaCore.getOptions();
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_10, options);
|
||||
parser.setCompilerOptions(options);
|
||||
parser.setKind(ASTParser.K_COMPILATION_UNIT);
|
||||
parser.setStatementsRecovery(true);
|
||||
|
||||
@@ -141,9 +141,9 @@ public final class CompilationUnitCache {
|
||||
}
|
||||
|
||||
public static CompilationUnit parse(char[] source, String docURI, String unitName, String[] classpathEntries) throws Exception {
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS9);
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS10);
|
||||
Map<String, String> options = JavaCore.getOptions();
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_10, options);
|
||||
parser.setCompilerOptions(options);
|
||||
parser.setKind(ASTParser.K_COMPILATION_UNIT);
|
||||
parser.setStatementsRecovery(true);
|
||||
|
||||
@@ -359,7 +359,7 @@ public class SpringIndexer {
|
||||
|
||||
private void scanProject(IJavaProject project, String[] files) {
|
||||
try {
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS9);
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS10);
|
||||
String[] classpathEntries = getClasspathEntries(project);
|
||||
|
||||
scanFiles(parser, files, classpathEntries);
|
||||
@@ -370,9 +370,9 @@ public class SpringIndexer {
|
||||
}
|
||||
|
||||
private void scanFile(String docURI, String content, String[] classpathEntries) throws Exception {
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS9);
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS10);
|
||||
Map<String, String> options = JavaCore.getOptions();
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_10, options);
|
||||
parser.setCompilerOptions(options);
|
||||
parser.setKind(ASTParser.K_COMPILATION_UNIT);
|
||||
parser.setStatementsRecovery(true);
|
||||
@@ -408,7 +408,7 @@ public class SpringIndexer {
|
||||
private void scanFiles(ASTParser parser, String[] javaFiles, String[] classpathEntries) throws Exception {
|
||||
|
||||
Map<String, String> options = JavaCore.getOptions();
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_10, options);
|
||||
parser.setCompilerOptions(options);
|
||||
parser.setKind(ASTParser.K_COMPILATION_UNIT);
|
||||
parser.setStatementsRecovery(true);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"displayName": "Bosh Editor",
|
||||
"description": "Provides validation and content assist for various Bosh configuration files",
|
||||
"icon": "icon.png",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"publisher": "Pivotal",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"displayName": "Concourse CI Pipeline Editor",
|
||||
"description": "Provides validation and content assist for Concourse CI pipeline and task configuration yml files",
|
||||
"icon": "icon.png",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"publisher": "Pivotal",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"displayName": "Cloudfoundry Manifest YML Support",
|
||||
"description": "Adds linting, content assist and hoverinfo's for Cloudfoundry Deployment Manifests (a.k.a. `manifest.yml`) files.",
|
||||
"icon": "icon.png",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"publisher": "Pivotal",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"displayName": "Spring Boot Tools",
|
||||
"description": "Provides validation and content assist for Spring Boot `application.properties`, `application.yml` properties files. As well as Boot-specific support for `.java` files.",
|
||||
"icon": "spring-boot-logo.png",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"publisher": "Pivotal",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -58,6 +58,17 @@
|
||||
"configuration": "./properties-support/language-configuration.json"
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
"type": "object",
|
||||
"title": "Boot-Java Configuration",
|
||||
"properties": {
|
||||
"boot-java.boot-hints.on": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Enable/Disable Spring running Boot application live hints decorators in the source code"
|
||||
}
|
||||
}
|
||||
},
|
||||
"grammars": [
|
||||
{
|
||||
"language": "spring-boot-properties-yaml",
|
||||
|
||||
Reference in New Issue
Block a user