Add documentEdit and friends helper functions
[opengl.git] / example / Main.hs
index 9318bcb7df8249fe8821dba52c255e278dc8b5bf..4891c6c12219cf34d85b1b23bb1a303cbb17bd6f 100644 (file)
@@ -1,16 +1,13 @@
 import Language.Haskell.LSP.Test
-import qualified Language.Haskell.LSP.TH.DataTypesJSON as LSP
-import qualified Data.Text.IO as T
-import Control.Lens
-import Control.Monad
+import Language.Haskell.LSP.TH.DataTypesJSON
+
 import Control.Monad.IO.Class
-import System.Directory
-import System.Environment
 
-main = do
-  files <- getArgs
-  forM_ files $ \file -> session $ do
-    file <- liftIO $ canonicalizePath file
-    openDocument file
-    symbols <- documentSymbols file
-    liftIO $ mapM_ T.putStrLn (symbols ^.. traverse . LSP.name)
+main = runSession "hie --lsp" "test/recordings/renamePass" $ do
+  docItem <- openDoc "Desktop/simple.hs" "haskell"
+  
+  sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams docItem)
+
+  skipMany loggingNotification
+
+  anyResponse >>= liftIO . print