removed outdated self-defined system property for boot-java language server
This commit is contained in:
@@ -68,8 +68,6 @@ import com.google.common.collect.ImmutableList;
|
||||
*/
|
||||
public class BootJavaLanguageServer extends SimpleLanguageServer {
|
||||
|
||||
public static final String LANGUAGE_SERVER_PROCESS_PROPERTY = "spring-boot-language-server";
|
||||
|
||||
private final VscodeCompletionEngineAdapter completionEngine;
|
||||
private final SpringIndexer indexer;
|
||||
private final SpringPropertyIndexProvider propertyIndexProvider;
|
||||
@@ -89,8 +87,6 @@ public class BootJavaLanguageServer extends SimpleLanguageServer {
|
||||
|
||||
propertyIndexProvider = serverParams.indexProvider;
|
||||
|
||||
System.setProperty(LANGUAGE_SERVER_PROCESS_PROPERTY, LANGUAGE_SERVER_PROCESS_PROPERTY);
|
||||
|
||||
JavaProjectFinder javaProjectFinder = serverParams.projectFinder;
|
||||
SimpleWorkspaceService workspaceService = getWorkspaceService();
|
||||
SimpleTextDocumentService documents = getTextDocumentService();
|
||||
|
||||
@@ -225,9 +225,7 @@ public class BootJavaHoverProvider implements HoverHandler {
|
||||
|
||||
private SpringBootApp[] getRunningSpringApps(IJavaProject project) {
|
||||
try {
|
||||
return runningAppProvider.getAllRunningSpringApps().stream()
|
||||
.filter((app) -> !app.containsSystemProperty(BootJavaLanguageServer.LANGUAGE_SERVER_PROCESS_PROPERTY))
|
||||
.toArray(SpringBootApp[]::new);
|
||||
return runningAppProvider.getAllRunningSpringApps().toArray(new SpringBootApp[0]);
|
||||
} catch (Exception e) {
|
||||
Log.log(e);
|
||||
return new SpringBootApp[0];
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.util.concurrent.ConcurrentSkipListSet;
|
||||
|
||||
import org.eclipse.lsp4j.Range;
|
||||
import org.eclipse.lsp4j.TextDocumentIdentifier;
|
||||
import org.springframework.ide.vscode.boot.java.BootJavaLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.java.handlers.BootJavaHoverProvider;
|
||||
import org.springframework.ide.vscode.boot.java.handlers.RunningAppProvider;
|
||||
import org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp;
|
||||
@@ -89,10 +88,7 @@ public class SpringLiveHoverWatchdog {
|
||||
public void update(String docURI) {
|
||||
if (highlightsEnabled) {
|
||||
try {
|
||||
SpringBootApp[] runningBootApps = runningAppProvider.getAllRunningSpringApps().stream()
|
||||
.filter((app) -> !app.containsSystemProperty(BootJavaLanguageServer.LANGUAGE_SERVER_PROCESS_PROPERTY))
|
||||
.toArray(SpringBootApp[]::new);
|
||||
|
||||
SpringBootApp[] runningBootApps = runningAppProvider.getAllRunningSpringApps().toArray(new SpringBootApp[0]);
|
||||
TextDocument doc = this.server.getTextDocumentService().get(docURI);
|
||||
if (doc != null) {
|
||||
Range[] ranges = this.hoverProvider.getLiveHoverHints(doc, runningBootApps);
|
||||
|
||||
@@ -65,7 +65,6 @@ public class ConditionalsLiveHoverTest {
|
||||
// Build a mock running boot app
|
||||
mockAppProvider.builder()
|
||||
.isSpringBootApp(true)
|
||||
.containsLanguageServerProcessPropery(false)
|
||||
.port("1111")
|
||||
.processId("22022")
|
||||
.host("cfapps.io")
|
||||
@@ -90,7 +89,7 @@ public class ConditionalsLiveHoverTest {
|
||||
String docUri = "file://" + directory.getAbsolutePath() + "/src/main/java/example/ConditionalOnMissingBeanConfig.java";
|
||||
|
||||
// Build a mock running boot app
|
||||
mockAppProvider.builder().isSpringBootApp(true).containsLanguageServerProcessPropery(false).port("1111")
|
||||
mockAppProvider.builder().isSpringBootApp(true).port("1111")
|
||||
.processId("22022").host("cfapps.io").processName("test-conditionals-live-hover")
|
||||
.getAutoConfigReport(
|
||||
"{\"positiveMatches\":{\"ConditionalOnMissingBeanConfig#missing\":[{\"condition\":\"OnBeanCondition\",\"message\":\"@ConditionalOnMissingBean (types: example.Hello; SearchStrategy: all) did not find any beans\"}]}}")
|
||||
|
||||
@@ -49,7 +49,6 @@ public class RequestMappingLiveHoverTest {
|
||||
// Build a mock running boot app
|
||||
mockAppProvider.builder()
|
||||
.isSpringBootApp(true)
|
||||
.containsLanguageServerProcessPropery(false)
|
||||
.port("1111")
|
||||
.processId("22022")
|
||||
.host("cfapps.io")
|
||||
@@ -82,7 +81,6 @@ public class RequestMappingLiveHoverTest {
|
||||
// Build a mock running boot app
|
||||
mockAppProvider.builder()
|
||||
.isSpringBootApp(true)
|
||||
.containsLanguageServerProcessPropery(false)
|
||||
.port("999")
|
||||
.processId("76543")
|
||||
.host("cfapps.io")
|
||||
|
||||
@@ -17,7 +17,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.mockito.Mockito;
|
||||
import org.springframework.ide.vscode.boot.java.BootJavaLanguageServer;
|
||||
import org.springframework.ide.vscode.boot.java.handlers.RunningAppProvider;
|
||||
import org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp;
|
||||
import org.springframework.ide.vscode.commons.util.ExceptionUtil;
|
||||
@@ -94,12 +93,6 @@ public class MockRunningAppProvider {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MockAppBuilder containsLanguageServerProcessPropery(boolean hasProperty) {
|
||||
when(app.containsSystemProperty(BootJavaLanguageServer.LANGUAGE_SERVER_PROCESS_PROPERTY))
|
||||
.thenReturn(hasProperty);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MockAppBuilder getRequestMappings(String mappings) throws Exception {
|
||||
when(app.getRequestMappings()).thenReturn(mappings);
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user