Add haddock to runSessionWithHandles
authorLuke Lau <luke_lau@icloud.com>
Tue, 1 Sep 2020 16:08:30 +0000 (17:08 +0100)
committerLuke Lau <luke_lau@icloud.com>
Fri, 9 Oct 2020 12:56:37 +0000 (13:56 +0100)
src/Language/Haskell/LSP/Test.hs

index 9866be9efd93987f40e0585dc0d4abac034f2cc0..7f13a44bfd4627b55610a8b6c9f9e18bbceada73 100644 (file)
@@ -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