Skip to content

Commit c09e40a

Browse files
authored
Merge pull request #448 from codedownio/lsp-test-monadthrow
lsp-test: Add MonadThrow instance to Session
2 parents a41954e + 65ffbbf commit c09e40a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lsp-test/lsp-test.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ library
5151
, data-default
5252
, Diff >= 0.3
5353
, directory
54+
, exceptions
5455
, filepath
5556
, Glob >= 0.9 && < 0.11
5657
, lens
@@ -101,7 +102,7 @@ test-suite func-test
101102
main-is: FuncTest.hs
102103
hs-source-dirs: func-test
103104
type: exitcode-stdio-1.0
104-
build-depends: base
105+
build-depends: base
105106
, lsp-test
106107
, lsp
107108
, process

lsp-test/src/Language/LSP/Test/Session.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ import Control.Concurrent hiding (yield)
4040
import Control.Exception
4141
import Control.Lens hiding (List, Empty)
4242
import Control.Monad
43-
import Control.Monad.IO.Class
43+
import Control.Monad.Catch (MonadThrow)
4444
import Control.Monad.Except
45+
import Control.Monad.IO.Class
4546
#if __GLASGOW_HASKELL__ == 806
4647
import Control.Monad.Fail
4748
#endif
@@ -92,7 +93,7 @@ import Colog.Core (LogAction (..), WithSeverity (..), Severity (..))
9293
-- 'Language.LSP.Test.sendNotification'.
9394

9495
newtype Session a = Session (ConduitParser FromServerMessage (StateT SessionState (ReaderT SessionContext IO)) a)
95-
deriving (Functor, Applicative, Monad, MonadIO, Alternative)
96+
deriving (Functor, Applicative, Monad, MonadIO, Alternative, MonadThrow)
9697

9798
#if __GLASGOW_HASKELL__ >= 806
9899
instance MonadFail Session where

0 commit comments

Comments
 (0)