-runSession :: SessionContext -> SessionState -> Session a -> IO (a, SessionState)
-runSession context state (Session session) = runReaderT (runStateT conduit state) context
+runSessionasdf :: SessionContext -> SessionState -> Session a -> IO (a, SessionState)
+runSessionasdf context state (Session session) = runReaderT (runStateT conduit state) context
-- | An internal version of 'runSession' that allows for a custom handler to listen to the server.
-- It also does not automatically send initialize and exit messages.
-- | An internal version of 'runSession' that allows for a custom handler to listen to the server.
-- It also does not automatically send initialize and exit messages.
let context = SessionContext serverIn absRootDir messageChan timeoutIdVar reqMap initRsp config caps
initState vfs = SessionState 0 vfs mempty False Nothing mempty
let context = SessionContext serverIn absRootDir messageChan timeoutIdVar reqMap initRsp config caps
initState vfs = SessionState 0 vfs mempty False Nothing mempty
server = (Just serverIn, Just serverOut, Nothing, serverProc)
msgTimeoutMs = messageTimeout config * 10^6
serverAndListenerFinalizer tid = do
server = (Just serverIn, Just serverOut, Nothing, serverProc)
msgTimeoutMs = messageTimeout config * 10^6
serverAndListenerFinalizer tid = do
finally (timeout msgTimeoutMs (runSession' exitServer)) $ do
-- Make sure to kill the listener first, before closing
-- handles etc via cleanupProcess
killThread tid
-- Give the server some time to exit cleanly
finally (timeout msgTimeoutMs (runSession' exitServer)) $ do
-- Make sure to kill the listener first, before closing
-- handles etc via cleanupProcess
killThread tid
-- Give the server some time to exit cleanly
(result, _) <- bracket serverListenerLauncher
serverAndListenerFinalizer
(result, _) <- bracket serverListenerLauncher
serverAndListenerFinalizer
s { curDynCaps = Map.union (Map.fromList newRegs) (curDynCaps s) }
updateState (FromServerMess SClientUnregisterCapability req) = do
s { curDynCaps = Map.union (Map.fromList newRegs) (curDynCaps s) }
updateState (FromServerMess SClientUnregisterCapability req) = do