@@ -33,8 +33,6 @@ import Ide.Types
33
33
import qualified Language.LSP.Protocol.Lens as L
34
34
import Language.LSP.Protocol.Message
35
35
import Language.LSP.Protocol.Types
36
- import Language.LSP.Server (LspT , getClientCapabilities ,
37
- sendRequest )
38
36
39
37
data Log
40
38
= DoesNotSupportResolve T. Text
@@ -60,7 +58,7 @@ mkCodeActionHandlerWithResolve
60
58
mkCodeActionHandlerWithResolve recorder codeActionMethod codeResolveMethod =
61
59
let newCodeActionMethod ideState pid params =
62
60
do codeActionReturn <- codeActionMethod ideState pid params
63
- caps <- lift getClientCapabilities
61
+ caps <- lift pluginGetClientCapabilities
64
62
case codeActionReturn of
65
63
r@ (InR Null ) -> pure r
66
64
(InL ls) | -- We don't need to do anything if the client supports
@@ -74,7 +72,7 @@ mkCodeActionHandlerWithResolve recorder codeActionMethod codeResolveMethod =
74
72
<> mkResolveHandler SMethod_CodeActionResolve codeResolveMethod)
75
73
where dropData :: CodeAction -> CodeAction
76
74
dropData ca = ca & L. data_ .~ Nothing
77
- resolveCodeAction :: Uri -> ideState -> PluginId -> (Command |? CodeAction ) -> ExceptT PluginError (LspT Config IO ) (Command |? CodeAction )
75
+ resolveCodeAction :: Uri -> ideState -> PluginId -> (Command |? CodeAction ) -> ExceptT PluginError (HandlerM Config ) (Command |? CodeAction )
78
76
resolveCodeAction _uri _ideState _plId c@ (InL _) = pure c
79
77
resolveCodeAction uri ideState pid (InR codeAction@ CodeAction {_data_= Just value}) = do
80
78
case A. fromJSON value of
@@ -105,7 +103,7 @@ mkCodeActionWithResolveAndCommand
105
103
mkCodeActionWithResolveAndCommand recorder plId codeActionMethod codeResolveMethod =
106
104
let newCodeActionMethod ideState pid params =
107
105
do codeActionReturn <- codeActionMethod ideState pid params
108
- caps <- lift getClientCapabilities
106
+ caps <- lift pluginGetClientCapabilities
109
107
case codeActionReturn of
110
108
r@ (InR Null ) -> pure r
111
109
(InL ls) | -- We don't need to do anything if the client supports
@@ -145,7 +143,7 @@ mkCodeActionWithResolveAndCommand recorder plId codeActionMethod codeResolveMeth
145
143
resolveResult <- resolveProvider ideState plId ca uri innerValueDecoded
146
144
case resolveResult of
147
145
ca2@ CodeAction {_edit = Just wedits } | diffCodeActions ca ca2 == [" edit" ] -> do
148
- _ <- ExceptT $ Right <$> sendRequest SMethod_WorkspaceApplyEdit (ApplyWorkspaceEditParams Nothing wedits) handleWEditCallback
146
+ _ <- ExceptT $ Right <$> pluginSendRequest SMethod_WorkspaceApplyEdit (ApplyWorkspaceEditParams Nothing wedits) handleWEditCallback
149
147
pure $ InR Null
150
148
ca2@ CodeAction {_edit = Just _ } ->
151
149
throwError $ internalError $
0 commit comments