X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=example%2FMain.hs;h=4891c6c12219cf34d85b1b23bb1a303cbb17bd6f;hb=22df37c703e39fa5ebeb130be5785b3a9713c520;hp=9318bcb7df8249fe8821dba52c255e278dc8b5bf;hpb=41ecc7bd7a4c9c92f966562bff4bfc2adbc20cff;p=opengl.git diff --git a/example/Main.hs b/example/Main.hs index 9318bcb..4891c6c 100644 --- a/example/Main.hs +++ b/example/Main.hs @@ -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