From ee929db57277393643de13e9759614cdec7cf432 Mon Sep 17 00:00:00 2001 From: Fredrik Sommar Date: Fri, 24 May 2024 15:12:48 +0200 Subject: [PATCH] Fix for null resolveProvider in codeAction The resolveProvider field doesn't need to be present even if the codeAction param is. From the specification: ``` export interface CodeActionOptions extends WorkDoneProgressOptions { /** * CodeActionKinds that this server may return. * * The list of kinds may be generic, such as `CodeActionKind.Refactor`, * or the server may list out every specific kind they provide. */ codeActionKinds?: CodeActionKind[]; /** * The server provides support to resolve additional * information for a code action. * * @since 3.16.0 */ resolveProvider?: boolean; } ``` --- .../languageserver/requestmanager/DefaultRequestManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/wso2/lsp4intellij/client/languageserver/requestmanager/DefaultRequestManager.java b/src/main/java/org/wso2/lsp4intellij/client/languageserver/requestmanager/DefaultRequestManager.java index ad2f2c83..acf3fca2 100644 --- a/src/main/java/org/wso2/lsp4intellij/client/languageserver/requestmanager/DefaultRequestManager.java +++ b/src/main/java/org/wso2/lsp4intellij/client/languageserver/requestmanager/DefaultRequestManager.java @@ -737,6 +737,7 @@ private boolean checkCodeActionProvider(Either provi private boolean checkCodeActionResolveProvider(Either provider) { return provider != null && provider.isRight() && provider.getRight() != null + && provider.getRight().getResolveProvider() != null && provider.getRight().getResolveProvider(); } }