Complete documentation and update .cabal
[lsp-test.git] / src / Language / Haskell / LSP / Test / Session.hs
index 39a3ed29bd4b44d406d4cc288eca49fa3540faaf..8e4754f391fe606decc98280b66c2364ef598d92 100644 (file)
@@ -65,12 +65,7 @@ import System.IO
 -- You can send and receive messages to the server within 'Session' via 'getMessage',
 -- 'sendRequest' and 'sendNotification'.
 --
--- @
--- runSession \"path\/to\/root\/dir\" $ do
---   docItem <- getDocItem "Desktop/simple.hs" "haskell"
---   sendNotification TextDocumentDidOpen (DidOpenTextDocumentParams docItem)
---   diagnostics <- getMessage :: Session PublishDiagnosticsNotification
--- @
+
 type Session = ParserStateReader FromServerMessage SessionState SessionContext IO
 
 -- | Stuff you can configure for a 'Session'.
@@ -81,6 +76,7 @@ data SessionConfig = SessionConfig
   , logColor       :: Bool -- ^ Add ANSI color to the logged messages, defaults to True.
   }
 
+-- | The configuration used in 'Language.Haskell.LSP.Test.runSession'.
 defaultConfig :: SessionConfig
 defaultConfig = SessionConfig 60 False True True
 
@@ -302,14 +298,6 @@ withTimeout duration f = do
                    }
   return res
 
--- logClientMsg :: (MonadIO m, HasReader SessionContext m)
---              => FromClientMessage -> m ()
--- logClientMsg = logMsg True
-
--- logServerMsg :: (MonadIO m, HasReader SessionContext m)
---              => FromServerMessage -> m ()
--- logServerMsg = logMsg False
-
 data LogMsgType = LogServer | LogClient
   deriving Eq
 
@@ -331,6 +319,4 @@ logMsg t msg = do
           | t == LogServer  = Magenta
           | otherwise       = Cyan
   
-
-showPretty :: ToJSON a => a -> String
         showPretty = B.unpack . encodePretty