projects
/
lsp-test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f3a1c84
)
Change runSession return result from passed session instead of ()
author
Luke Lau
<luke_lau@icloud.com>
Wed, 13 Jun 2018 17:31:44 +0000
(13:31 -0400)
committer
Luke Lau
<luke_lau@icloud.com>
Wed, 13 Jun 2018 17:31:44 +0000
(13:31 -0400)
src/Language/Haskell/LSP/Test.hs
patch
|
blob
|
history
diff --git
a/src/Language/Haskell/LSP/Test.hs
b/src/Language/Haskell/LSP/Test.hs
index 8da0cbbee8ba065533e8e0d06ac79e3f35ee4612..4f3094f87d58034d5fc2b0d11c87973464ddd7d4 100644
(file)
--- 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.
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
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
sendNotification Initialized InitializedParams
-- Run the actual test
- session
+
result <-
session
sendNotification Exit ExitParams
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 ())
-- | 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 ())