diff --git a/lsp-test/src/Language/LSP/Test/Session.hs b/lsp-test/src/Language/LSP/Test/Session.hs index f3d6f8c28..61695686e 100644 --- a/lsp-test/src/Language/LSP/Test/Session.hs +++ b/lsp-test/src/Language/LSP/Test/Session.hs @@ -38,7 +38,7 @@ where import Control.Applicative import Control.Concurrent hiding (yield) import Control.Exception -import Control.Lens hiding (List) +import Control.Lens hiding (List, Empty) import Control.Monad import Control.Monad.IO.Class import Control.Monad.Except @@ -304,7 +304,7 @@ updateStateC = awaitForever $ \msg -> do where respond :: (MonadIO m, HasReader SessionContext m) => FromServerMessage -> m () respond (FromServerMess SWindowWorkDoneProgressCreate req) = - sendMessage $ ResponseMessage "2.0" (Just $ req ^. LSP.id) (Right ()) + sendMessage $ ResponseMessage "2.0" (Just $ req ^. LSP.id) (Right Empty) respond (FromServerMess SWorkspaceApplyEdit r) = do sendMessage $ ResponseMessage "2.0" (Just $ r ^. LSP.id) (Right $ ApplyWorkspaceEditResponseBody True Nothing) respond _ = pure () diff --git a/lsp-types/src/Language/LSP/Types/Message.hs b/lsp-types/src/Language/LSP/Types/Message.hs index b1aadbfce..9108033b6 100644 --- a/lsp-types/src/Language/LSP/Types/Message.hs +++ b/lsp-types/src/Language/LSP/Types/Message.hs @@ -197,7 +197,7 @@ type family ResponseResult (m :: Method f Request) :: Type where -- Server -- Window ResponseResult WindowShowMessageRequest = Maybe MessageActionItem - ResponseResult WindowWorkDoneProgressCreate = () + ResponseResult WindowWorkDoneProgressCreate = Empty -- Capability ResponseResult ClientRegisterCapability = Empty ResponseResult ClientUnregisterCapability = Empty @@ -233,7 +233,7 @@ deriving instance Eq (MessageParams m) => Eq (NotificationMessage m) deriving instance Show (MessageParams m) => Show (NotificationMessage m) instance (FromJSON (MessageParams m), FromJSON (SMethod m)) => FromJSON (NotificationMessage m) where - parseJSON = genericParseJSON lspOptions + parseJSON = genericParseJSON lspOptions . addNullField "params" instance (ToJSON (MessageParams m)) => ToJSON (NotificationMessage m) where toJSON = genericToJSON lspOptions toEncoding = genericToEncoding lspOptions diff --git a/src/Language/LSP/Server/Core.hs b/src/Language/LSP/Server/Core.hs index 2e8fd0a44..2ea84ff5e 100644 --- a/src/Language/LSP/Server/Core.hs +++ b/src/Language/LSP/Server/Core.hs @@ -620,7 +620,7 @@ withProgressBase indefinite title cancellable f = do -- An error ocurred when the client was setting it up -- No need to do anything then, as per the spec Left _err -> pure () - Right () -> pure () + Right Empty -> pure () -- Send the begin and done notifications via 'bracket_' so that they are always fired res <- withRunInIO $ \runInBase ->