X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=example%2FMain.hs;h=4891c6c12219cf34d85b1b23bb1a303cbb17bd6f;hb=22df37c703e39fa5ebeb130be5785b3a9713c520;hp=4dd268c907d8c96b8af2bee7b7eff27de2b2b4ad;hpb=1f4a12c49be0cb8640d60c21f6499c5567646fba;p=opengl.git diff --git a/example/Main.hs b/example/Main.hs index 4dd268c..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 $ \fp -> manualSession $ do - file <- liftIO $ canonicalizePath fp - 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