From bf93e74482200ee189ca0be09970b9a34bb1511c Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 13 Jun 2018 13:31:44 -0400 Subject: [PATCH] Change runSession return result from passed session instead of () --- src/Language/Haskell/LSP/Test.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Language/Haskell/LSP/Test.hs b/src/Language/Haskell/LSP/Test.hs index 8da0cbb..4f3094f 100644 --- a/src/Language/Haskell/LSP/Test.hs +++ b/src/Language/Haskell/LSP/Test.hs @@ -85,7 +85,7 @@ import Language.Haskell.LSP.Test.Parsing runSession :: String -- ^ The command to run the server. -> FilePath -- ^ The filepath to the root directory for the session. -> Session a -- ^ The session to run. - -> IO () + -> IO a runSession serverExe rootDir session = do pid <- getProcessID absRootDir <- canonicalizePath rootDir @@ -112,10 +112,12 @@ runSession serverExe rootDir session = do sendNotification Initialized InitializedParams -- Run the actual test - session + result <- session sendNotification Exit ExitParams + return result + -- | 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. runSessionWithHandler :: (Handle -> Session ()) -- 2.30.2