It's not needed since the captured session should contain it anyway
, module Language.Haskell.LSP.Test.Parsing
-- * Utilities
-- | Quick helper functions for common tasks.
, module Language.Haskell.LSP.Test.Parsing
-- * Utilities
-- | Quick helper functions for common tasks.
-- ** Documents
, openDoc
, openDoc'
-- ** Documents
, openDoc
, openDoc'
-> Session a -- ^ The session to run.
-> IO a
runSessionWithConfig config serverExe caps rootDir session = do
-> Session a -- ^ The session to run.
-> IO a
runSessionWithConfig config serverExe caps rootDir session = do
pid <- getCurrentProcessID
absRootDir <- canonicalizePath rootDir
pid <- getCurrentProcessID
absRootDir <- canonicalizePath rootDir
result <- session
return result
where
result <- session
return result
where
+ -- | Asks the server to shutdown and exit politely
+ exitServer :: Session ()
+ exitServer = request_ Shutdown (Nothing :: Maybe Value) >> sendNotification Exit ExitParams
+
-- | Listens to the server output until the shutdown ack,
-- makes sure it matches the record and signals any semaphores
listenServer :: Handle -> SessionContext -> IO ()
-- | Listens to the server output until the shutdown ack,
-- makes sure it matches the record and signals any semaphores
listenServer :: Handle -> SessionContext -> IO ()
rsp <- request TextDocumentCodeLens (CodeLensParams tId) :: Session CodeLensResponse
case getResponseResult rsp of
List res -> pure res
rsp <- request TextDocumentCodeLens (CodeLensParams tId) :: Session CodeLensResponse
case getResponseResult rsp of
List res -> pure res
-
--- | Exit the server after request its shutdown
-exitServer :: Session()
-exitServer = request_ Shutdown (Nothing :: Maybe Value) >> sendNotification Exit ExitParams
+ (return ()) -- No finalizer cleanup
(sendMessages clientMsgs reqSema rspSema)
takeMVar passSema
killThread sessionThread
(sendMessages clientMsgs reqSema rspSema)
takeMVar passSema
killThread sessionThread
-> Session a
-> IO a
runSessionWithHandles serverIn serverOut serverProc serverHandler config caps rootDir exitServer session = do
-> Session a
-> IO a
runSessionWithHandles serverIn serverOut serverProc serverHandler config caps rootDir exitServer session = do
absRootDir <- canonicalizePath rootDir
hSetBuffering serverIn NoBuffering
absRootDir <- canonicalizePath rootDir
hSetBuffering serverIn NoBuffering