Update to haskell-lsp-0.7
[opengl.git] / src / Language / Haskell / LSP / Test / Session.hs
index 39a3ed29bd4b44d406d4cc288eca49fa3540faaf..175f5705c965fe3a05c448ed55ab352e3acead16 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,8 +76,9 @@ 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
+defaultConfig = SessionConfig 60 False False True
 
 instance Default SessionConfig where
   def = defaultConfig
@@ -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