Some steps towards mergin boot-java and boot-properties LS
- Refactor towards more composable LanguageServers - disable fatjar support on boot-java and boot-properties
This commit is contained in:
@@ -10,11 +10,13 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Configure fat jar -->
|
||||
<!-- Configure fat jar
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
@@ -127,6 +127,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
-->
|
||||
<!-- Ignore test classes from test projects -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -64,6 +64,7 @@ import org.springframework.ide.vscode.commons.languageserver.reconcile.IReconcil
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.LSFactory;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.ReferencesHandler;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServerWrapper;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleWorkspaceService;
|
||||
import org.springframework.ide.vscode.commons.util.text.TextDocument;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SpringIndexerBeansTest {
|
||||
|
||||
@Test
|
||||
public void testScanSimpleConfigurationClass() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SpringIndexerBeansTest {
|
||||
}
|
||||
|
||||
@Test public void testScanSpecialConfigurationClass() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -87,7 +87,7 @@ public class SpringIndexerBeansTest {
|
||||
|
||||
@Test
|
||||
public void testScanSimpleComponentClass() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -98,7 +98,7 @@ public class SpringIndexerBeansTest {
|
||||
}
|
||||
|
||||
@Test public void testScanSimpleControllerClass() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -109,7 +109,7 @@ public class SpringIndexerBeansTest {
|
||||
}
|
||||
|
||||
@Test public void testScanRestControllerClass() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SpringIndexerFunctionBeansTest {
|
||||
|
||||
@Test
|
||||
public void testScanSimpleFunctionBean() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SpringIndexerFunctionBeansTest {
|
||||
|
||||
@Test
|
||||
public void testScanSimpleFunctionClass() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -71,7 +71,7 @@ public class SpringIndexerFunctionBeansTest {
|
||||
|
||||
@Test
|
||||
public void testScanSpecializedFunctionClass() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -83,7 +83,7 @@ public class SpringIndexerFunctionBeansTest {
|
||||
|
||||
@Test
|
||||
public void testScanSpecializedFunctionInterface() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -95,7 +95,7 @@ public class SpringIndexerFunctionBeansTest {
|
||||
|
||||
@Test
|
||||
public void testNoSymbolForAbstractClasses() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -105,7 +105,7 @@ public class SpringIndexerFunctionBeansTest {
|
||||
|
||||
@Test
|
||||
public void testNoSymbolForSubInterfaces() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
@@ -115,7 +115,7 @@ public class SpringIndexerFunctionBeansTest {
|
||||
|
||||
@Test
|
||||
public void testScanInconsistentInterfaceHierarchy() throws Exception {
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServer(), projectFinder, symbolProviders);
|
||||
SpringIndexerHarness indexer = new SpringIndexerHarness(harness.getServerWrapper(), projectFinder, symbolProviders);
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-beans/").toURI());
|
||||
indexer.initialize(indexer.wsFolder(directory));
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/SimpleMappingClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertEquals(1, symbols.size());
|
||||
assertTrue(containsSymbol(symbols, "@/greeting", docUri, 6, 1, 6, 29));
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/ParentMappingClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertEquals(1, symbols.size());
|
||||
assertTrue(containsSymbol(symbols, "@/parent/greeting -- GET", docUri, 8, 1, 8, 47));
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/ParentMappingClass2.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertEquals(1, symbols.size());
|
||||
assertTrue(containsSymbol(symbols, "@/parent2 -- GET,POST,DELETE", docUri, 8, 1, 8, 16));
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/MultiRequestMappingClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertEquals(2, symbols.size());
|
||||
assertTrue(containsSymbol(symbols, "@/hello1", docUri, 6, 1, 6, 44));
|
||||
assertTrue(containsSymbol(symbols, "@/hello2", docUri, 6, 1, 6, 44));
|
||||
@@ -91,7 +91,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/RequestMethodClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertTrue(containsSymbol(symbols, "@/getData -- GET", docUri, 12, 1, 12, 24));
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/RequestMethodClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertTrue(containsSymbol(symbols, "@/deleteData -- DELETE",docUri, 20, 1, 20, 30));
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/RequestMethodClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertTrue(containsSymbol(symbols, "@/postData -- POST", docUri, 24, 1, 24, 26));
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/RequestMethodClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertTrue(containsSymbol(symbols, "@/putData -- PUT", docUri, 16, 1, 16, 24));
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/RequestMethodClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertTrue(containsSymbol(symbols, "@/patchData -- PATCH", docUri, 28, 1, 28, 28));
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/RequestMethodClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertTrue(containsSymbol(symbols, "@/getHello -- GET", docUri, 32, 1, 32, 61));
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class RequestMappingSymbolProviderTest {
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-request-mapping-symbols/").toURI());
|
||||
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/RequestMethodClass.java").toUri().toString();
|
||||
List<? extends SymbolInformation> symbols = harness.getServer().getSpringIndexer().getSymbols(docUri);
|
||||
List<? extends SymbolInformation> symbols = harness.getServerWrapper().getSpringIndexer().getSymbols(docUri);
|
||||
assertTrue(containsSymbol(symbols, "@/postAndPutHello -- POST,PUT", docUri, 36, 1, 36, 76));
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class CompilationUnitCacheTest {
|
||||
}
|
||||
|
||||
private CompilationUnit getCompilationUnit(TextDocument doc) {
|
||||
return harness.getServer().getCompilationUnitCache().withCompilationUnit(doc, cu -> cu);
|
||||
return harness.getServerWrapper().getCompilationUnitCache().withCompilationUnit(doc, cu -> cu);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SpringIndexerTest {
|
||||
private LanguageServerHarness<BootJavaLanguageServer> harness;
|
||||
|
||||
private SpringIndexer indexer() {
|
||||
return harness.getServer().getSpringIndexer();
|
||||
return harness.getServerWrapper().getSpringIndexer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SpringPropertyIndexTest {
|
||||
@Test
|
||||
public void testPropertiesIndexRefreshOnProjectChange() throws Exception {
|
||||
harness.intialize(new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-parent/test-annotation-indexing/").toURI()));
|
||||
propertyIndexProvider = (DefaultSpringPropertyIndexProvider) harness.getServer().getSpringPropertyIndexProvider();
|
||||
propertyIndexProvider = (DefaultSpringPropertyIndexProvider) harness.getServerWrapper().getSpringPropertyIndexProvider();
|
||||
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/test-annotation-indexing-parent/test-annotation-indexing/").toURI());
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.ide.vscode.languageserver.testharness.LanguageServerH
|
||||
public class BootLanguageServerHarness extends LanguageServerHarness<BootJavaLanguageServer> {
|
||||
|
||||
private PropertyIndexHarness indexHarness;
|
||||
private final JavaProjectFinder projectFinder = (doc) -> getServer().getProjectFinder().find(doc);
|
||||
private final JavaProjectFinder projectFinder = (doc) -> getServerWrapper().getProjectFinder().find(doc);
|
||||
|
||||
/**
|
||||
* Creates a builder and initializes it so that it sets up a test harness with
|
||||
|
||||
@@ -12,6 +12,8 @@ package org.springframework.ide.vscode.boot;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServerParams;
|
||||
import org.springframework.ide.vscode.commons.languageserver.LaunguageServerApp;
|
||||
import org.springframework.ide.vscode.commons.util.LogRedirect;
|
||||
|
||||
@@ -29,7 +31,8 @@ public class Main {
|
||||
LogRedirect.redirectToFile(serverName);
|
||||
//TODO: wrap both BootProperties and BootJavaLanguageServers into a composite of some kind.
|
||||
LaunguageServerApp.start(serverName,
|
||||
() -> new BootPropertiesLanguageServer(BootPropertiesLanguageServerParams.createDefault()));
|
||||
() -> new BootPropertiesLanguageServer(BootPropertiesLanguageServerParams.createDefault()).getServer()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,11 +10,13 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Configure fat jar -->
|
||||
<!-- Configure fat jar
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
@@ -111,9 +111,12 @@
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<finalName>${project.build.finalName}-fat</finalName>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugin> -->
|
||||
<!-- Ignore test classes from test projects -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -117,7 +117,7 @@ public abstract class CachingValueProvider implements ValueProviderStrategy {
|
||||
// Log.log(e);
|
||||
}
|
||||
if (cached!=null) {
|
||||
System.out.println("cached "+subquery+": "+cached);
|
||||
// debug("cached "+subquery+": "+cached);
|
||||
if (cached.isComplete) {
|
||||
return cached.values
|
||||
// .doOnNext((hint) -> debug("filter["+query+"]: "+hint.getValue()))
|
||||
|
||||
@@ -28,11 +28,11 @@ import org.springframework.ide.vscode.commons.java.IClasspath;
|
||||
import org.springframework.ide.vscode.commons.util.Log;
|
||||
|
||||
public class PropertiesLoader {
|
||||
|
||||
|
||||
private static final String MAIN_SPRING_CONFIGURATION_METADATA_JSON = "META-INF/spring-configuration-metadata.json";
|
||||
|
||||
public static final String ADDITIONAL_SPRING_CONFIGURATION_METADATA_JSON = "META-INF/additional-spring-configuration-metadata.json";
|
||||
|
||||
|
||||
/**
|
||||
* The default classpath location for config metadata loaded when scanning .jar files on the classpath.
|
||||
*/
|
||||
@@ -48,15 +48,15 @@ public class PropertiesLoader {
|
||||
MAIN_SPRING_CONFIGURATION_METADATA_JSON,
|
||||
ADDITIONAL_SPRING_CONFIGURATION_METADATA_JSON
|
||||
};
|
||||
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(PropertiesLoader.class.getName());
|
||||
|
||||
|
||||
private ConfigurationMetadataRepositoryJsonBuilder builder = ConfigurationMetadataRepositoryJsonBuilder.create();
|
||||
|
||||
|
||||
public ConfigurationMetadataRepository load(IClasspath classPath) {
|
||||
try {
|
||||
classPath.getClasspathEntries().forEach(entry -> {
|
||||
Log.info("Indexing "+entry);
|
||||
//Log.info("Indexing "+entry);
|
||||
File fileEntry = entry.toFile();
|
||||
if (fileEntry.exists()) {
|
||||
if (fileEntry.isDirectory()) {
|
||||
@@ -72,7 +72,7 @@ public class PropertiesLoader {
|
||||
ConfigurationMetadataRepository repository = builder.build();
|
||||
return repository;
|
||||
}
|
||||
|
||||
|
||||
private void loadFromOutputFolder(Path outputFolderPath) {
|
||||
if (outputFolderPath != null && Files.exists(outputFolderPath)) {
|
||||
Arrays.stream(PROJECT_META_DATA_LOCATIONS).forEach(mdLoc -> {
|
||||
@@ -100,7 +100,7 @@ public class PropertiesLoader {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void loadFromJar(Path f) {
|
||||
JarFile jarFile = null;
|
||||
try {
|
||||
@@ -145,5 +145,5 @@ public class PropertiesLoader {
|
||||
private void loadFromInputStream(Object origin, InputStream is) throws IOException {
|
||||
builder.withJsonResource(origin, is);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* Pivotal, Inc. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.vscode.boot;
|
||||
package org.springframework.ide.vscode.boot.properties;
|
||||
|
||||
import org.springframework.ide.vscode.boot.common.PropertyCompletionFactory;
|
||||
import org.springframework.ide.vscode.boot.common.RelaxedNameConfig;
|
||||
@@ -30,6 +30,7 @@ import org.springframework.ide.vscode.commons.languageserver.java.ProjectObserve
|
||||
import org.springframework.ide.vscode.commons.languageserver.reconcile.IReconcileEngine;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.LSFactory;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServerWrapper;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService;
|
||||
import org.springframework.ide.vscode.commons.util.FuzzyMap;
|
||||
import org.springframework.ide.vscode.commons.util.text.IDocument;
|
||||
@@ -53,7 +54,7 @@ import com.google.common.collect.ImmutableList;
|
||||
* @author Alex Boyko
|
||||
*
|
||||
*/
|
||||
public class BootPropertiesLanguageServer extends SimpleLanguageServer {
|
||||
public class BootPropertiesLanguageServer implements SimpleLanguageServerWrapper {
|
||||
|
||||
private static final String YML = ".yml";
|
||||
private static final String PROPERTIES = ".properties";
|
||||
@@ -78,11 +79,11 @@ public class BootPropertiesLanguageServer extends SimpleLanguageServer {
|
||||
private final YamlASTProvider parser = new YamlParser(yaml);
|
||||
private final YamlStructureProvider yamlStructureProvider= YamlStructureProvider.DEFAULT;
|
||||
private YamlAssistContextProvider yamlAssistContextProvider;
|
||||
private final SimpleLanguageServer server;
|
||||
|
||||
public BootPropertiesLanguageServer(LSFactory<BootPropertiesLanguageServerParams> _params) {
|
||||
super("vscode-boot-properties");
|
||||
|
||||
BootPropertiesLanguageServerParams serverParams = _params.create(this);
|
||||
this.server = new SimpleLanguageServer("vscode-boot-properties");
|
||||
BootPropertiesLanguageServerParams serverParams = _params.create(server);
|
||||
|
||||
this.indexProvider = serverParams.indexProvider;
|
||||
this.typeUtilProvider = serverParams.typeUtilProvider;
|
||||
@@ -99,22 +100,22 @@ public class BootPropertiesLanguageServer extends SimpleLanguageServer {
|
||||
}
|
||||
};
|
||||
|
||||
SimpleTextDocumentService documents = getTextDocumentService();
|
||||
SimpleTextDocumentService documents = server.getTextDocumentService();
|
||||
|
||||
IReconcileEngine reconcileEngine = getReconcileEngine();
|
||||
documents.onDidChangeContent(params -> {
|
||||
TextDocument doc = params.getDocument();
|
||||
validateWith(doc.getId(), reconcileEngine);
|
||||
server.validateWith(doc.getId(), reconcileEngine);
|
||||
});
|
||||
|
||||
ICompletionEngine propertiesCompletionEngine = getCompletionEngine();
|
||||
completionEngine = createCompletionEngineAdapter(this, propertiesCompletionEngine);
|
||||
completionEngine = server.createCompletionEngineAdapter(server, propertiesCompletionEngine);
|
||||
completionEngine.setMaxCompletions(100);
|
||||
documents.onCompletion(completionEngine::getCompletions);
|
||||
documents.onCompletionResolve(completionEngine::resolveCompletion);
|
||||
|
||||
HoverInfoProvider hoverInfoProvider = getHoverProvider();
|
||||
hoverEngine = new VscodeHoverEngineAdapter(this, hoverInfoProvider);
|
||||
hoverEngine = new VscodeHoverEngineAdapter(server, hoverInfoProvider);
|
||||
documents.onHover(hoverEngine::getHover);
|
||||
}
|
||||
|
||||
@@ -187,4 +188,9 @@ public class BootPropertiesLanguageServer extends SimpleLanguageServer {
|
||||
public SpringPropertyIndexProvider getPropertiesIndexProvider() {
|
||||
return indexProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimpleLanguageServer getServer() {
|
||||
return this.server;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* Pivotal, Inc. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.vscode.boot;
|
||||
package org.springframework.ide.vscode.boot.properties;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
@@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* Pivotal, Inc. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.vscode.boot;
|
||||
package org.springframework.ide.vscode.boot.properties;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -17,18 +17,19 @@ import org.springframework.ide.vscode.commons.util.LogRedirect;
|
||||
|
||||
/**
|
||||
* Starts up Language Server process
|
||||
*
|
||||
*
|
||||
* @author Alex Boyko
|
||||
* @author Kris De Volder
|
||||
*
|
||||
*/
|
||||
public class Main {
|
||||
|
||||
|
||||
public static void main(String[] args) throws IOException, InterruptedException {
|
||||
String serverName = "boot-properties-language-server";
|
||||
LogRedirect.redirectToFile(serverName);
|
||||
LaunguageServerApp.start(serverName,
|
||||
() -> new BootPropertiesLanguageServer(BootPropertiesLanguageServerParams.createDefault()));
|
||||
() -> new BootPropertiesLanguageServer(BootPropertiesLanguageServerParams.createDefault()).getServer()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,12 +24,12 @@ import org.eclipse.lsp4j.CompletionItem;
|
||||
import org.eclipse.lsp4j.Diagnostic;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServerParams;
|
||||
import org.springframework.ide.vscode.boot.editor.harness.AbstractPropsEditorTest;
|
||||
import org.springframework.ide.vscode.boot.editor.harness.StyledStringMatcher;
|
||||
import org.springframework.ide.vscode.boot.metadata.CachingValueProvider;
|
||||
import org.springframework.ide.vscode.boot.metadata.PropertiesLoader;
|
||||
import org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServerParams;
|
||||
import org.springframework.ide.vscode.commons.java.IJavaProject;
|
||||
import org.springframework.ide.vscode.commons.java.IType;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
|
||||
@@ -1590,7 +1590,7 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
s -> new BootPropertiesLanguageServerParams(javaProjectFinder, null, md.getIndexProvider(),
|
||||
typeUtilProvider));
|
||||
server.setMaxCompletionsNumber(-1);
|
||||
return server;
|
||||
return server.getServer();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,12 +20,12 @@ import org.eclipse.lsp4j.CompletionItem;
|
||||
import org.eclipse.lsp4j.Diagnostic;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServerParams;
|
||||
import org.springframework.ide.vscode.boot.editor.harness.AbstractPropsEditorTest;
|
||||
import org.springframework.ide.vscode.boot.editor.harness.StyledStringMatcher;
|
||||
import org.springframework.ide.vscode.boot.metadata.CachingValueProvider;
|
||||
import org.springframework.ide.vscode.boot.metadata.PropertyInfo;
|
||||
import org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServerParams;
|
||||
import org.springframework.ide.vscode.commons.java.IJavaProject;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
|
||||
import org.springframework.ide.vscode.commons.util.StringUtil;
|
||||
@@ -3710,7 +3710,7 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
s -> new BootPropertiesLanguageServerParams(javaProjectFinder, null, md.getIndexProvider(),
|
||||
typeUtilProvider));
|
||||
server.setMaxCompletionsNumber(-1);
|
||||
return server;
|
||||
return server.getServer();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2016 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.ide.vscode.boot.test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import org.eclipse.lsp4j.InitializeResult;
|
||||
import org.eclipse.lsp4j.TextDocumentSyncKind;
|
||||
import org.junit.Test;
|
||||
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServerParams;
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
|
||||
import org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness;
|
||||
|
||||
/**
|
||||
* Boot app properties file language server tests
|
||||
*
|
||||
* @author Alex Boyko
|
||||
*
|
||||
*/
|
||||
public class BootPropertiesLanguageServerTest {
|
||||
|
||||
public static File getTestResource(String name) throws URISyntaxException {
|
||||
return Paths.get(BootPropertiesLanguageServer.class.getResource(name).toURI()).toFile();
|
||||
}
|
||||
|
||||
private LanguageServerHarness newHarness() throws Exception {
|
||||
Callable<? extends SimpleLanguageServer> f = () -> new BootPropertiesLanguageServer(BootPropertiesLanguageServerParams.createTestDefault());
|
||||
return new LanguageServerHarness(f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createAndInitializeServerWithWorkspace() throws Exception {
|
||||
LanguageServerHarness harness = newHarness();
|
||||
File workspaceRoot = getTestResource("/workspace/");
|
||||
assertExpectedInitResult(harness.intialize(workspaceRoot));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createAndInitializeServerWithoutWorkspace() throws Exception {
|
||||
File workspaceRoot = null;
|
||||
LanguageServerHarness harness = newHarness();
|
||||
assertExpectedInitResult(harness.intialize(workspaceRoot));
|
||||
}
|
||||
|
||||
private void assertExpectedInitResult(InitializeResult initResult) {
|
||||
assertThat(initResult.getCapabilities().getTextDocumentSync().getLeft()).isEqualTo(TextDocumentSyncKind.Incremental);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,9 +20,9 @@ import java.io.File;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServerParams;
|
||||
import org.springframework.ide.vscode.boot.metadata.DefaultSpringPropertyIndexProvider;
|
||||
import org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServerParams;
|
||||
import org.springframework.ide.vscode.commons.languageserver.ProgressService;
|
||||
import org.springframework.ide.vscode.commons.maven.MavenCore;
|
||||
import org.springframework.ide.vscode.commons.util.text.LanguageId;
|
||||
@@ -32,12 +32,12 @@ import org.springframework.ide.vscode.project.harness.ProjectsHarness;
|
||||
|
||||
/**
|
||||
* Tests for Boot properties index
|
||||
*
|
||||
*
|
||||
* @author Alex Boyko
|
||||
*
|
||||
*/
|
||||
public class SpringPropertiesIndexTest {
|
||||
|
||||
|
||||
private LanguageServerHarness<BootPropertiesLanguageServer> harness;
|
||||
|
||||
private DefaultSpringPropertyIndexProvider propertyIndexProvider;
|
||||
@@ -50,7 +50,7 @@ public class SpringPropertiesIndexTest {
|
||||
@Test
|
||||
public void testPropertiesIndexRefreshOnProjectChange() throws Exception {
|
||||
harness.intialize(new File(ProjectsHarness.class.getResource("/test-projects/boot-1.2.0-properties-live-metadta/").toURI()));
|
||||
propertyIndexProvider = (DefaultSpringPropertyIndexProvider) harness.getServer().getPropertiesIndexProvider();
|
||||
propertyIndexProvider = (DefaultSpringPropertyIndexProvider) harness.getServerWrapper().getPropertiesIndexProvider();
|
||||
|
||||
File directory = new File(ProjectsHarness.class.getResource("/test-projects/boot-1.2.0-properties-live-metadta/").toURI());
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ public class BoshEditorTest {
|
||||
}
|
||||
|
||||
@Test public void releasesBlockCompletions() throws Exception {
|
||||
harness.getServer().enableSnippets(false);
|
||||
harness.getServerWrapper().enableSnippets(false);
|
||||
Editor editor = harness.newEditor(
|
||||
"releases:\n" +
|
||||
"- <*>"
|
||||
@@ -359,7 +359,7 @@ public class BoshEditorTest {
|
||||
}
|
||||
|
||||
@Test public void instanceGroupsCompletions() throws Exception {
|
||||
harness.getServer().enableSnippets(false);
|
||||
harness.getServerWrapper().enableSnippets(false);
|
||||
Editor editor = harness.newEditor(
|
||||
"instance_groups:\n" +
|
||||
"- <*>"
|
||||
@@ -543,7 +543,7 @@ public class BoshEditorTest {
|
||||
}
|
||||
|
||||
@Test public void updateBlockCompletions() throws Exception {
|
||||
harness.getServer().enableSnippets(false);
|
||||
harness.getServerWrapper().enableSnippets(false);
|
||||
Editor editor = harness.newEditor(
|
||||
"update:\n" +
|
||||
" <*>"
|
||||
@@ -583,7 +583,7 @@ public class BoshEditorTest {
|
||||
}
|
||||
|
||||
@Test public void variablesBlockCompletions() throws Exception {
|
||||
harness.getServer().enableSnippets(false);
|
||||
harness.getServerWrapper().enableSnippets(false);
|
||||
Editor editor = harness.newEditor(
|
||||
"variables:\n" +
|
||||
"- <*>"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
@@ -25,6 +26,7 @@
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -10,11 +10,13 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -76,7 +76,7 @@ import reactor.core.scheduler.Schedulers;
|
||||
* here so we can try to keep the subclass itself more 'clutter free' and focus on
|
||||
* what its really doing and not the 'wiring and plumbing'.
|
||||
*/
|
||||
public abstract class SimpleLanguageServer implements Sts4LanguageServer, LanguageClientAware, ServiceNotificationsClient, WorkspaceFoldersProposedService {
|
||||
public class SimpleLanguageServer implements Sts4LanguageServer, LanguageClientAware, ServiceNotificationsClient, WorkspaceFoldersProposedService, SimpleLanguageServerWrapper {
|
||||
|
||||
private static final Scheduler RECONCILER_SCHEDULER = Schedulers.newSingle("Reconciler");
|
||||
|
||||
@@ -116,7 +116,7 @@ public abstract class SimpleLanguageServer implements Sts4LanguageServer, Langua
|
||||
this.client = (STS4LanguageClient) _client;
|
||||
}
|
||||
|
||||
protected VscodeCompletionEngineAdapter createCompletionEngineAdapter(SimpleLanguageServer server, ICompletionEngine engine) {
|
||||
public VscodeCompletionEngineAdapter createCompletionEngineAdapter(SimpleLanguageServer server, ICompletionEngine engine) {
|
||||
return new VscodeCompletionEngineAdapter(server, engine, completionResolver);
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ public abstract class SimpleLanguageServer implements Sts4LanguageServer, Langua
|
||||
* Convenience method. Subclasses can call this to use a {@link IReconcileEngine} ported
|
||||
* from old STS codebase to validate a given {@link TextDocument} and publish Diagnostics.
|
||||
*/
|
||||
protected void validateWith(TextDocumentIdentifier docId, IReconcileEngine engine) {
|
||||
public void validateWith(TextDocumentIdentifier docId, IReconcileEngine engine) {
|
||||
CompletableFuture<Void> reconcileSession = this.busyReconcile = new CompletableFuture<Void>();
|
||||
// Log.debug("Reconciling BUSY");
|
||||
|
||||
@@ -547,4 +547,9 @@ public abstract class SimpleLanguageServer implements Sts4LanguageServer, Langua
|
||||
return diagnosticService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimpleLanguageServer getServer() {
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 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.ide.vscode.commons.languageserver.util;
|
||||
|
||||
public interface SimpleLanguageServerWrapper {
|
||||
|
||||
SimpleLanguageServer getServer();
|
||||
|
||||
}
|
||||
@@ -10,11 +10,13 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
@@ -97,6 +97,7 @@ import org.springframework.ide.vscode.commons.languageserver.quickfix.QuickfixEd
|
||||
import org.springframework.ide.vscode.commons.languageserver.util.LanguageServerTestListener;
|
||||
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.SimpleLanguageServerWrapper;
|
||||
import org.springframework.ide.vscode.commons.util.Assert;
|
||||
import org.springframework.ide.vscode.commons.util.ExceptionUtil;
|
||||
import org.springframework.ide.vscode.commons.util.IOUtil;
|
||||
@@ -111,7 +112,7 @@ import com.google.common.collect.MultimapBuilder;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
public class LanguageServerHarness<S extends SimpleLanguageServer> {
|
||||
public class LanguageServerHarness<S extends SimpleLanguageServerWrapper> {
|
||||
|
||||
//Warning this 'harness' is incomplete. Growing it as needed.
|
||||
|
||||
@@ -709,10 +710,14 @@ public class LanguageServerHarness<S extends SimpleLanguageServer> {
|
||||
}
|
||||
|
||||
public void changeConfiguration(Settings settings) {
|
||||
server.getWorkspaceService().didChangeConfiguration(new DidChangeConfigurationParams(settings));
|
||||
getServer().getWorkspaceService().didChangeConfiguration(new DidChangeConfigurationParams(settings));
|
||||
}
|
||||
|
||||
public S getServer() {
|
||||
public SimpleLanguageServer getServer() {
|
||||
return server==null ? null : server.getServer();
|
||||
}
|
||||
|
||||
public S getServerWrapper() {
|
||||
return server;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,13 @@
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
|
||||
Reference in New Issue
Block a user