From 74c491fb3c87a385d03edac920d22793ecb981c0 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Tue, 1 Sep 2020 17:08:30 +0100 Subject: [PATCH] Add haddock to runSessionWithHandles --- src/Language/Haskell/LSP/Test.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Language/Haskell/LSP/Test.hs b/src/Language/Haskell/LSP/Test.hs index 9866be9..7f13a44 100644 --- a/src/Language/Haskell/LSP/Test.hs +++ b/src/Language/Haskell/LSP/Test.hs @@ -155,7 +155,16 @@ runSessionWithConfig config' serverExe caps rootDir session = do withServer serverExe (logStdErr config) $ \serverIn serverOut serverProc -> runSessionWithHandles' (Just serverProc) serverIn serverOut config caps rootDir session - +-- | Starts a new session, using the specified handles to communicate with the +-- server. You can use this to host the server within the same process. +-- An example with haskell-lsp might look like: +-- +-- > (hinRead, hinWrite) <- createPipe +-- > (houtRead, houtWrite) <- createPipe +-- > +-- > forkIO $ void $ runWithHandles hinRead houtWrite initCallbacks handlers def +-- > Test.runSessionWithHandles hinWrite houtRead defaultConfig fullCaps "." $ do +-- > -- ... runSessionWithHandles :: Handle -- ^ The input handle -> Handle -- ^ The output handle -> SessionConfig -- 2.30.2