Skip to content

Commit ca8b400

Browse files
authored
Merge pull request #490 from joyfulmantis/resolve-fix
Fix codeActions resolve capabilities support
2 parents 98ba7cc + 5919f15 commit ca8b400

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

lsp/src/Language/LSP/Server/Processing.hs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,21 @@ inferServerCapabilities clientCaps o h =
253253
| otherwise = Nothing
254254

255255
clientSupportsCodeActionKinds = isJust $
256-
clientCaps ^? L.textDocument . _Just . L.codeAction . _Just . L.codeActionLiteralSupport
256+
clientCaps ^? L.textDocument . _Just . L.codeAction . _Just . L.codeActionLiteralSupport . _Just
257257

258258
codeActionProvider
259-
| clientSupportsCodeActionKinds
260-
, supported_b SMethod_TextDocumentCodeAction = Just $ case optCodeActionKinds o of
261-
Just ks -> InR $ CodeActionOptions Nothing (Just ks) (supported SMethod_CodeLensResolve)
262-
Nothing -> InL True
263-
| supported_b SMethod_TextDocumentCodeAction = Just (InL True)
259+
| supported_b SMethod_TextDocumentCodeAction = Just $ InR $
260+
CodeActionOptions {
261+
_workDoneProgress = Nothing
262+
, _codeActionKinds = codeActionKinds (optCodeActionKinds o)
263+
, _resolveProvider = supported SMethod_CodeActionResolve
264+
}
264265
| otherwise = Just (InL False)
265266

267+
codeActionKinds (Just ks)
268+
| clientSupportsCodeActionKinds = Just ks
269+
codeActionKinds _ = Nothing
270+
266271
signatureHelpProvider
267272
| supported_b SMethod_TextDocumentSignatureHelp = Just $
268273
SignatureHelpOptions

0 commit comments

Comments
 (0)