Reexport modules via cabal
[lsp-test.git] / example / Main.hs
index 4891c6c12219cf34d85b1b23bb1a303cbb17bd6f..c992b8ea67390760497b6fdee187078c428489a8 100644 (file)
@@ -1,13 +1,19 @@
-import Language.Haskell.LSP.Test
-import Language.Haskell.LSP.TH.DataTypesJSON
-
+import Control.Applicative.Combinators
 import Control.Monad.IO.Class
+import Language.Haskell.LSP.Test
+import Language.Haskell.LSP.Types
 
 main = runSession "hie --lsp" "test/recordings/renamePass" $ do
   docItem <- openDoc "Desktop/simple.hs" "haskell"
   
-  sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams docItem)
+  -- Use your favourite favourite combinators.
+  skipManyTill loggingNotification (count 2 publishDiagnosticsNotification)
+
+  -- Send requests and notifications and receive responses
+  let params = DocumentSymbolParams docItem
+  response <- sendRequest TextDocumentDocumentSymbol params :: Session DocumentSymbolsResponse
+  liftIO $ print response
 
-  skipMany loggingNotification
+  -- Or use one of the helper functions
+  getDocumentSymbols docItem >>= liftIO . print
 
-  anyResponse >>= liftIO . print