@@ -33,8 +33,6 @@ import Ide.Types
3333import qualified Language.LSP.Protocol.Lens as L
3434import Language.LSP.Protocol.Message
3535import Language.LSP.Protocol.Types
36- import Language.LSP.Server (LspT , getClientCapabilities ,
37- sendRequest )
3836
3937data Log
4038 = DoesNotSupportResolve T. Text
@@ -60,7 +58,7 @@ mkCodeActionHandlerWithResolve
6058mkCodeActionHandlerWithResolve recorder codeActionMethod codeResolveMethod =
6159 let newCodeActionMethod ideState pid params =
6260 do codeActionReturn <- codeActionMethod ideState pid params
63- caps <- lift getClientCapabilities
61+ caps <- lift pluginGetClientCapabilities
6462 case codeActionReturn of
6563 r@ (InR Null ) -> pure r
6664 (InL ls) | -- We don't need to do anything if the client supports
@@ -74,7 +72,7 @@ mkCodeActionHandlerWithResolve recorder codeActionMethod codeResolveMethod =
7472 <> mkResolveHandler SMethod_CodeActionResolve codeResolveMethod)
7573 where dropData :: CodeAction -> CodeAction
7674 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 )
7876 resolveCodeAction _uri _ideState _plId c@ (InL _) = pure c
7977 resolveCodeAction uri ideState pid (InR codeAction@ CodeAction {_data_= Just value}) = do
8078 case A. fromJSON value of
@@ -105,7 +103,7 @@ mkCodeActionWithResolveAndCommand
105103mkCodeActionWithResolveAndCommand recorder plId codeActionMethod codeResolveMethod =
106104 let newCodeActionMethod ideState pid params =
107105 do codeActionReturn <- codeActionMethod ideState pid params
108- caps <- lift getClientCapabilities
106+ caps <- lift pluginGetClientCapabilities
109107 case codeActionReturn of
110108 r@ (InR Null ) -> pure r
111109 (InL ls) | -- We don't need to do anything if the client supports
@@ -145,7 +143,7 @@ mkCodeActionWithResolveAndCommand recorder plId codeActionMethod codeResolveMeth
145143 resolveResult <- resolveProvider ideState plId ca uri innerValueDecoded
146144 case resolveResult of
147145 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
149147 pure $ InR Null
150148 ca2@ CodeAction {_edit = Just _ } ->
151149 throwError $ internalError $
0 commit comments