diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeActionProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeActionProvider.java index 21dd8b697..7fce04599 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeActionProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeActionProvider.java @@ -29,8 +29,6 @@ public interface MicroProfileJavaCodeActionProvider { @JsonRequest("microprofile/java/codeAction") - default CompletableFuture> getJavaCodeAction(MicroProfileJavaCodeActionParams javaParams) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture> getJavaCodeAction(MicroProfileJavaCodeActionParams javaParams); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeActionResolveProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeActionResolveProvider.java index bbc236490..3c7978c99 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeActionResolveProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeActionResolveProvider.java @@ -25,8 +25,6 @@ public interface MicroProfileJavaCodeActionResolveProvider { @JsonRequest("microprofile/java/codeActionResolve") - default CompletableFuture resolveCodeAction(CodeAction unresolved) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture resolveCodeAction(CodeAction unresolved); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeLensProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeLensProvider.java index 6f1459bf3..ab39bd8d6 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeLensProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCodeLensProvider.java @@ -29,8 +29,6 @@ public interface MicroProfileJavaCodeLensProvider { @JsonRequest("microprofile/java/codeLens") - default CompletableFuture> getJavaCodelens(MicroProfileJavaCodeLensParams javaParams) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture> getJavaCodelens(MicroProfileJavaCodeLensParams javaParams); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCompletionProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCompletionProvider.java index b6f7a4eae..fb3f795c5 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCompletionProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCompletionProvider.java @@ -27,8 +27,6 @@ public interface MicroProfileJavaCompletionProvider { @JsonRequest("microprofile/java/completion") - default CompletableFuture getJavaCompletion(MicroProfileJavaCompletionParams javaParams) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture getJavaCompletion(MicroProfileJavaCompletionParams javaParams); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCursorContextProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCursorContextProvider.java index e24e44681..f5345968c 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCursorContextProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaCursorContextProvider.java @@ -20,16 +20,14 @@ import org.eclipse.lsp4mp.commons.MicroProfileJavaCompletionParams; /** - * Returns context related to the cursor location in the given document, - * or null if the client doesn't yet support this. + * Returns context related to the cursor location in the given document, or null + * if the client doesn't yet support this. * * @see JavaCursorContextResult */ public interface MicroProfileJavaCursorContextProvider { @JsonRequest("microprofile/java/javaCursorContext") - default CompletableFuture getJavaCursorContext(MicroProfileJavaCompletionParams context) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture getJavaCursorContext(MicroProfileJavaCompletionParams context); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaDefinitionProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaDefinitionProvider.java index 9d438df38..2acf3aba2 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaDefinitionProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaDefinitionProvider.java @@ -27,9 +27,6 @@ public interface MicroProfileJavaDefinitionProvider { @JsonRequest("microprofile/java/definition") - default CompletableFuture> getJavaDefinition( - MicroProfileJavaDefinitionParams javaParams) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture> getJavaDefinition(MicroProfileJavaDefinitionParams javaParams); } \ No newline at end of file diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaDiagnosticsProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaDiagnosticsProvider.java index 14bebc5b7..a6f4d33cf 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaDiagnosticsProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaDiagnosticsProvider.java @@ -27,9 +27,6 @@ public interface MicroProfileJavaDiagnosticsProvider { @JsonRequest("microprofile/java/diagnostics") - default CompletableFuture> getJavaDiagnostics( - MicroProfileJavaDiagnosticsParams javaParams) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture> getJavaDiagnostics(MicroProfileJavaDiagnosticsParams javaParams); } \ No newline at end of file diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaFileInfoProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaFileInfoProvider.java index a8593a29a..ed05eea9e 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaFileInfoProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaFileInfoProvider.java @@ -28,8 +28,6 @@ public interface MicroProfileJavaFileInfoProvider { @JsonRequest("microprofile/java/fileInfo") - default CompletableFuture getJavaFileInfo(MicroProfileJavaFileInfoParams javaParams) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture getJavaFileInfo(MicroProfileJavaFileInfoParams javaParams); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaHoverProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaHoverProvider.java index fd882b16e..4b6a2f997 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaHoverProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaHoverProvider.java @@ -26,8 +26,6 @@ public interface MicroProfileJavaHoverProvider { @JsonRequest("microprofile/java/hover") - default CompletableFuture getJavaHover(MicroProfileJavaHoverParams javaParams) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture getJavaHover(MicroProfileJavaHoverParams javaParams); } \ No newline at end of file diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaProjectLabelsProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaProjectLabelsProvider.java index 6f35a1d01..097cb1a9a 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaProjectLabelsProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaProjectLabelsProvider.java @@ -29,14 +29,9 @@ public interface MicroProfileJavaProjectLabelsProvider { @JsonRequest("microprofile/java/projectLabels") - default CompletableFuture getJavaProjectLabels( - MicroProfileJavaProjectLabelsParams javaParams) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture getJavaProjectLabels(MicroProfileJavaProjectLabelsParams javaParams); @JsonRequest("microprofile/java/workspaceLabels") - default CompletableFuture> getAllJavaProjectLabels() { - return CompletableFuture.completedFuture(null); - } + CompletableFuture> getAllJavaProjectLabels(); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaWorkspaceSymbolsProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaWorkspaceSymbolsProvider.java index 53dab056b..036e5deeb 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaWorkspaceSymbolsProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfileJavaWorkspaceSymbolsProvider.java @@ -27,8 +27,6 @@ public interface MicroProfileJavaWorkspaceSymbolsProvider { @JsonRequest("microprofile/java/workspaceSymbols") - default CompletableFuture> getJavaWorkspaceSymbols(String projectUri) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture> getJavaWorkspaceSymbols(String projectUri); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfilePropertyDefinitionProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfilePropertyDefinitionProvider.java index 2d9bc84e9..0ed54a45b 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfilePropertyDefinitionProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfilePropertyDefinitionProvider.java @@ -28,8 +28,6 @@ public interface MicroProfilePropertyDefinitionProvider { @JsonRequest("microprofile/propertyDefinition") - default CompletableFuture getPropertyDefinition(MicroProfilePropertyDefinitionParams params) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture getPropertyDefinition(MicroProfilePropertyDefinitionParams params); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfilePropertyDocumentationProvider.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfilePropertyDocumentationProvider.java index 773884880..d69d57a0e 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfilePropertyDocumentationProvider.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/api/MicroProfilePropertyDocumentationProvider.java @@ -24,8 +24,6 @@ public interface MicroProfilePropertyDocumentationProvider { @JsonRequest("microprofile/propertyDocumentation") - default CompletableFuture getPropertyDocumentation(MicroProfilePropertyDocumentationParams params) { - return CompletableFuture.completedFuture(null); - } + CompletableFuture getPropertyDocumentation(MicroProfilePropertyDocumentationParams params); } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/MockMicroProfileLanguageClient.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/MockMicroProfileLanguageClient.java index a400727b5..fd64d39e5 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/MockMicroProfileLanguageClient.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/MockMicroProfileLanguageClient.java @@ -17,16 +17,34 @@ import java.util.Map; import java.util.concurrent.CompletableFuture; +import org.eclipse.lsp4j.CodeAction; +import org.eclipse.lsp4j.CodeLens; +import org.eclipse.lsp4j.Hover; import org.eclipse.lsp4j.Location; import org.eclipse.lsp4j.MessageActionItem; import org.eclipse.lsp4j.MessageParams; import org.eclipse.lsp4j.PublishDiagnosticsParams; import org.eclipse.lsp4j.ShowMessageRequestParams; +import org.eclipse.lsp4j.SymbolInformation; +import org.eclipse.lsp4mp.commons.JavaCursorContextResult; +import org.eclipse.lsp4mp.commons.JavaFileInfo; +import org.eclipse.lsp4mp.commons.MicroProfileDefinition; +import org.eclipse.lsp4mp.commons.MicroProfileJavaCodeActionParams; +import org.eclipse.lsp4mp.commons.MicroProfileJavaCodeLensParams; +import org.eclipse.lsp4mp.commons.MicroProfileJavaCompletionParams; +import org.eclipse.lsp4mp.commons.MicroProfileJavaCompletionResult; +import org.eclipse.lsp4mp.commons.MicroProfileJavaDefinitionParams; +import org.eclipse.lsp4mp.commons.MicroProfileJavaDiagnosticsParams; +import org.eclipse.lsp4mp.commons.MicroProfileJavaFileInfoParams; +import org.eclipse.lsp4mp.commons.MicroProfileJavaHoverParams; +import org.eclipse.lsp4mp.commons.MicroProfileJavaProjectLabelsParams; import org.eclipse.lsp4mp.commons.MicroProfileProjectInfo; import org.eclipse.lsp4mp.commons.MicroProfileProjectInfoParams; import org.eclipse.lsp4mp.commons.MicroProfilePropertiesChangeEvent; import org.eclipse.lsp4mp.commons.MicroProfilePropertiesScope; import org.eclipse.lsp4mp.commons.MicroProfilePropertyDefinitionParams; +import org.eclipse.lsp4mp.commons.MicroProfilePropertyDocumentationParams; +import org.eclipse.lsp4mp.commons.ProjectLabelInfoEntry; import org.eclipse.lsp4mp.commons.metadata.ItemBase; import org.eclipse.lsp4mp.commons.metadata.ItemHint; import org.eclipse.lsp4mp.commons.metadata.ItemMetadata; @@ -73,7 +91,7 @@ public void showMessage(MessageParams messageParams) { @Override public CompletableFuture showMessageRequest(ShowMessageRequestParams requestParams) { - return null; + return CompletableFuture.completedFuture(null); } @Override @@ -220,4 +238,73 @@ public List getPublishDiagnostics() { return publishDiagnostics; } + @Override + public CompletableFuture getPropertyDocumentation(MicroProfilePropertyDocumentationParams params) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture> getJavaCodeAction(MicroProfileJavaCodeActionParams javaParams) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture> getJavaCodelens(MicroProfileJavaCodeLensParams javaParams) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture getJavaCompletion( + MicroProfileJavaCompletionParams javaParams) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture> getJavaDiagnostics( + MicroProfileJavaDiagnosticsParams javaParams) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture> getJavaDefinition( + MicroProfileJavaDefinitionParams javaParams) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture getJavaHover(MicroProfileJavaHoverParams javaParams) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture getJavaProjectLabels( + MicroProfileJavaProjectLabelsParams javaParams) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture> getAllJavaProjectLabels() { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture getJavaFileInfo(MicroProfileJavaFileInfoParams javaParams) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture resolveCodeAction(CodeAction unresolved) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture getJavaCursorContext(MicroProfileJavaCompletionParams context) { + return CompletableFuture.completedFuture(null); + } + + @Override + public CompletableFuture> getJavaWorkspaceSymbols(String projectUri) { + return CompletableFuture.completedFuture(null); + } + } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/deadlock/MicroProfileLanguageServerDeadlockTest.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/deadlock/MicroProfileLanguageServerDeadlockTest.java index 4b2644003..ca6f74477 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/deadlock/MicroProfileLanguageServerDeadlockTest.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/deadlock/MicroProfileLanguageServerDeadlockTest.java @@ -10,6 +10,20 @@ ******************************************************************************/ package org.eclipse.lsp4mp.ls.deadlock; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + import org.eclipse.lsp4j.DidOpenTextDocumentParams; import org.eclipse.lsp4j.MessageActionItem; import org.eclipse.lsp4j.MessageParams; @@ -22,32 +36,19 @@ import org.eclipse.lsp4mp.commons.MicroProfileProjectInfoParams; import org.eclipse.lsp4mp.commons.ProjectLabelInfoEntry; import org.eclipse.lsp4mp.ls.MicroProfileServerLauncher; -import org.eclipse.lsp4mp.ls.api.MicroProfileLanguageClientAPI; +import org.eclipse.lsp4mp.ls.MockMicroProfileLanguageClient; import org.eclipse.lsp4mp.ls.api.MicroProfileLanguageServerAPI; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.assertTrue; - public class MicroProfileLanguageServerDeadlockTest { - private static class MyLanguageClient implements MicroProfileLanguageClientAPI { + private static class MyLanguageClient extends MockMicroProfileLanguageClient { private final CountDownLatch latch; private MyLanguageClient(CountDownLatch latch) { + super(null); this.latch = latch; } diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/java/JavaTextDocumentsTest.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/java/JavaTextDocumentsTest.java index 482498cc3..0582cf843 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/java/JavaTextDocumentsTest.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/ls/java/JavaTextDocumentsTest.java @@ -50,6 +50,11 @@ public CompletableFuture getJavaProjectLabels( ProjectLabelInfoEntry projectInfo = new ProjectLabelInfoEntry(uri, "", labels); return CompletableFuture.completedFuture(projectInfo); } + + @Override + public CompletableFuture> getAllJavaProjectLabels() { + return CompletableFuture.completedFuture(null); + } }; @Test diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileAssert.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileAssert.java index 2d54dee2c..03ba47ba5 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileAssert.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileAssert.java @@ -20,6 +20,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -58,6 +59,7 @@ import org.eclipse.lsp4j.jsonrpc.json.adapters.EnumTypeAdapter; import org.eclipse.lsp4j.jsonrpc.messages.Either; import org.eclipse.lsp4mp.commons.MicroProfileProjectInfo; +import org.eclipse.lsp4mp.commons.MicroProfilePropertyDocumentationParams; import org.eclipse.lsp4mp.commons.codeaction.CodeActionData; import org.eclipse.lsp4mp.commons.codeaction.MicroProfileCodeActionId; import org.eclipse.lsp4mp.commons.metadata.ItemMetadata; @@ -216,7 +218,8 @@ public static void testCompletionFor(String value, boolean snippetSupport, boole assertCompletions(list, expectedCount, isItemDefaultsSupport, expectedItems); } - public static void assertCompletions(CompletionList actual, Integer expectedCount, CompletionItem... expectedItems) { + public static void assertCompletions(CompletionList actual, Integer expectedCount, + CompletionItem... expectedItems) { assertCompletions(actual, expectedCount, false, expectedItems); } @@ -254,8 +257,8 @@ private static void assertCompletion(CompletionList completions, boolean isItemD CompletionItem match = matches.get(0); if (expected.getTextEdit() != null && expected.getTextEdit().getLeft() != null) { - if (!isItemDefaultsSupport - || (match.getTextEdit() != null && match.getTextEdit().getLeft().getRange() != expected.getTextEdit().getLeft().getRange())) { + if (!isItemDefaultsSupport || (match.getTextEdit() != null + && match.getTextEdit().getLeft().getRange() != expected.getTextEdit().getLeft().getRange())) { assertEquals(expected.getTextEdit().getLeft().getNewText(), match.getTextEdit().getLeft().getNewText()); } else { assertEquals(expected.getTextEdit().getLeft().getNewText(), match.getTextEditText()); @@ -266,7 +269,8 @@ private static void assertCompletion(CompletionList completions, boolean isItemD ? expected.getTextEdit().getLeft().getRange() : null; if (r != null && r.getStart() != null && r.getEnd() != null) { - if (!isItemDefaultsSupport || (match.getTextEdit() != null && match.getTextEdit().getLeft().getRange() != expected.getTextEdit().getLeft().getRange())) { + if (!isItemDefaultsSupport || (match.getTextEdit() != null + && match.getTextEdit().getLeft().getRange() != expected.getTextEdit().getLeft().getRange())) { assertEquals(expected.getTextEdit().getLeft().getRange(), match.getTextEdit().getLeft().getRange()); } else { assertEquals(expected.getTextEdit().getLeft().getRange(), @@ -456,7 +460,8 @@ public static void assertCompletionWithProperties(String value, Integer expected // ------------------- Hover assert - public static void assertNoHover(String value) throws BadLocationException, InterruptedException, TimeoutException, ExecutionException { + public static void assertNoHover(String value) + throws BadLocationException, InterruptedException, TimeoutException, ExecutionException { MicroProfileHoverSettings hoverSettings = new MicroProfileHoverSettings(); hoverSettings.setCapabilities(new HoverCapabilities(Arrays.asList(MarkupKind.MARKDOWN), false)); assertHover(value, null, getDefaultMicroProfileProjectInfo(), hoverSettings, null, null); @@ -506,8 +511,15 @@ public static void assertHover(String value, String fileURI, MicroProfileProject PropertiesFileLanguageService languageService = new PropertiesFileLanguageService(); - Hover hover = languageService.doHover(model, position, projectInfo, hoverSettings, - new MicroProfilePropertyDocumentationProvider() {}, () -> { + Hover hover = languageService + .doHover(model, position, projectInfo, hoverSettings, new MicroProfilePropertyDocumentationProvider() { + + @Override + public CompletableFuture getPropertyDocumentation( + MicroProfilePropertyDocumentationParams params) { + return CompletableFuture.completedFuture(null); + } + }, () -> { }).get(2000, TimeUnit.MILLISECONDS); if (expectedHoverLabel == null) { Assert.assertNull(hover); @@ -752,7 +764,8 @@ public static CodeAction ca(String title, MicroProfileCodeActionId id, Command c return ca(title, id, null, command, d); } - public static CodeAction ca(String title, MicroProfileCodeActionId id, TextEdit te, Command command, Diagnostic... d) { + public static CodeAction ca(String title, MicroProfileCodeActionId id, TextEdit te, Command command, + Diagnostic... d) { List diagnostics = new ArrayList<>(); for (int i = 0; i < d.length; i++) { diagnostics.add(d[i]); @@ -760,7 +773,8 @@ public static CodeAction ca(String title, MicroProfileCodeActionId id, TextEdit return ca(title, id, te, command, diagnostics); } - public static CodeAction ca(String title, MicroProfileCodeActionId id, TextEdit te, Command command, List diagnostics) { + public static CodeAction ca(String title, MicroProfileCodeActionId id, TextEdit te, Command command, + List diagnostics) { CodeAction codeAction = new CodeAction(); codeAction.setTitle(title); codeAction.setDiagnostics(diagnostics); diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileCompletionTest.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileCompletionTest.java index 78111dd34..c3539267d 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileCompletionTest.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileCompletionTest.java @@ -12,8 +12,8 @@ import static org.eclipse.lsp4mp.services.properties.PropertiesFileAssert.c; import static org.eclipse.lsp4mp.services.properties.PropertiesFileAssert.r; import static org.eclipse.lsp4mp.services.properties.PropertiesFileAssert.testCompletionFor; -import static org.eclipse.lsp4mp.services.properties.PropertiesFileAssert.testCompletionItemUnresolvedFor; import static org.eclipse.lsp4mp.services.properties.PropertiesFileAssert.testCompletionItemResolveFor; +import static org.eclipse.lsp4mp.services.properties.PropertiesFileAssert.testCompletionItemUnresolvedFor; import java.util.ArrayList; import java.util.Collections; diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileHoverTest.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileHoverTest.java index 664efa4da..e1558079e 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileHoverTest.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/PropertiesFileHoverTest.java @@ -17,7 +17,6 @@ import org.eclipse.lsp4mp.commons.MicroProfileProjectInfo; import org.eclipse.lsp4mp.commons.metadata.ItemMetadata; -import org.eclipse.lsp4mp.ls.commons.BadLocationException; import org.junit.Test; /** diff --git a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/expressions/PropertiesFileExpressionHoverTest.java b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/expressions/PropertiesFileExpressionHoverTest.java index 16786f993..dccbc690c 100644 --- a/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/expressions/PropertiesFileExpressionHoverTest.java +++ b/microprofile.ls/org.eclipse.lsp4mp.ls/src/test/java/org/eclipse/lsp4mp/services/properties/expressions/PropertiesFileExpressionHoverTest.java @@ -13,7 +13,6 @@ import static org.eclipse.lsp4mp.services.properties.PropertiesFileAssert.assertHoverMarkdown; import static org.eclipse.lsp4mp.services.properties.PropertiesFileAssert.assertNoHover; -import org.eclipse.lsp4mp.ls.commons.BadLocationException; import org.junit.Test; /**