From 321af9f3d201c285cca2a00d444ba629deca152e Mon Sep 17 00:00:00 2001 From: payne911 <38117856+payne911@users.noreply.github.com> Date: Tue, 9 May 2023 16:13:38 -0400 Subject: [PATCH 1/3] Update LanguageServerDefinition.java --- .../serverdefinition/LanguageServerDefinition.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/wso2/lsp4intellij/client/languageserver/serverdefinition/LanguageServerDefinition.java b/src/main/java/org/wso2/lsp4intellij/client/languageserver/serverdefinition/LanguageServerDefinition.java index b1c7fc40..00aed7d4 100644 --- a/src/main/java/org/wso2/lsp4intellij/client/languageserver/serverdefinition/LanguageServerDefinition.java +++ b/src/main/java/org/wso2/lsp4intellij/client/languageserver/serverdefinition/LanguageServerDefinition.java @@ -77,6 +77,15 @@ public void stop(String workingDir) { public Object getInitializationOptions(URI uri) { return null; } + + /** + * Use this method to modify the {@link InitializeParams} that was initialized by this library. + * The values assigned to the passed {@link InitializeParams} after this method ends will be the + * ones sent to the LSP server. + * @param params the parameters with some prefilled values. + */ + public void customizeInitializeParams(InitializeParams params) { + } @Override public String toString() { From 50b072c8b211beaa15cb2fa861452ff754faa9d3 Mon Sep 17 00:00:00 2001 From: payne911 <38117856+payne911@users.noreply.github.com> Date: Tue, 9 May 2023 16:14:37 -0400 Subject: [PATCH 2/3] Update LanguageServerWrapper.java --- .../client/languageserver/wrapper/LanguageServerWrapper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/wso2/lsp4intellij/client/languageserver/wrapper/LanguageServerWrapper.java b/src/main/java/org/wso2/lsp4intellij/client/languageserver/wrapper/LanguageServerWrapper.java index 94827090..33cc3e5a 100644 --- a/src/main/java/org/wso2/lsp4intellij/client/languageserver/wrapper/LanguageServerWrapper.java +++ b/src/main/java/org/wso2/lsp4intellij/client/languageserver/wrapper/LanguageServerWrapper.java @@ -588,6 +588,7 @@ private InitializeParams getInitParams() { new ClientCapabilities(workspaceClientCapabilities, textDocumentClientCapabilities, null)); initParams.setInitializationOptions( serverDefinition.getInitializationOptions(URI.create(initParams.getRootUri()))); + serverDefinition.customizeInitializeParams(initParams); return initParams; } From 8f9dae370cf08a831bc4bd341294f455926c853f Mon Sep 17 00:00:00 2001 From: payne911 <38117856+payne911@users.noreply.github.com> Date: Tue, 9 May 2023 16:15:10 -0400 Subject: [PATCH 3/3] Update LanguageServerDefinition.java --- .../serverdefinition/LanguageServerDefinition.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/wso2/lsp4intellij/client/languageserver/serverdefinition/LanguageServerDefinition.java b/src/main/java/org/wso2/lsp4intellij/client/languageserver/serverdefinition/LanguageServerDefinition.java index 00aed7d4..f3eb0974 100644 --- a/src/main/java/org/wso2/lsp4intellij/client/languageserver/serverdefinition/LanguageServerDefinition.java +++ b/src/main/java/org/wso2/lsp4intellij/client/languageserver/serverdefinition/LanguageServerDefinition.java @@ -18,6 +18,7 @@ import com.intellij.openapi.diagnostic.Logger; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; +import org.eclipse.lsp4j.InitializeParams; import org.wso2.lsp4intellij.client.connection.StreamConnectionProvider; import java.io.IOException;