X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=src%2FLanguage%2FHaskell%2FLSP%2FTest%2FSession.hs;h=6599cbdef746b1aa659b7ea92ab6665639654e28;hb=22df37c703e39fa5ebeb130be5785b3a9713c520;hp=d12ed003a2d67e212156c9cbe5810c2ccc17055f;hpb=bd6901688e6c9d8332fea161260d32666885f9ed;p=opengl.git diff --git a/src/Language/Haskell/LSP/Test/Session.hs b/src/Language/Haskell/LSP/Test/Session.hs index d12ed00..6599cbd 100644 --- a/src/Language/Haskell/LSP/Test/Session.hs +++ b/src/Language/Haskell/LSP/Test/Session.hs @@ -60,8 +60,8 @@ type Session = ParserStateReader FromServerMessage SessionState SessionContext I -- | Stuff you can configure for a 'Session'. data SessionConfig = SessionConfig { - capabilities :: ClientCapabilities, -- ^ Specific capabilities the client should advertise. - timeout :: Int -- ^ Maximum time to wait for a request in seconds. + capabilities :: ClientCapabilities -- ^ Specific capabilities the client should advertise. Default is yes to everything. + , timeout :: Int -- ^ Maximum time to wait for a request in seconds. Defaults to 60. } instance Default SessionConfig where @@ -91,7 +91,7 @@ data SessionState = SessionState type ParserStateReader a s r m = ConduitParser a (StateT s (ReaderT r m)) -type SessionProcessor = ConduitT FromServerMessage FromServerMessage (StateT SessionState (ReaderT SessionContext IO)) +type SessionProcessor = ConduitM FromServerMessage FromServerMessage (StateT SessionState (ReaderT SessionContext IO)) runSession :: Chan FromServerMessage -> SessionProcessor () -> SessionContext -> SessionState -> Session a -> IO (a, SessionState) runSession chan preprocessor context state session = runReaderT (runStateT conduit state) context