X-Git-Url: http://git.lukelau.me/?p=lsp-test.git;a=blobdiff_plain;f=example%2FMain.hs;h=0318ce8c04f47243f3946bd1d755c336cc08e3e7;hp=cc74026531ead6183d384d9113fd001a8f60e510;hb=0e9ea704c2fd5ab6c762e709b4a4ad4b10169a7e;hpb=e2ae28cd825653b0cb8b982d113497e9ac795059 diff --git a/example/Main.hs b/example/Main.hs index cc74026..0318ce8 100644 --- a/example/Main.hs +++ b/example/Main.hs @@ -1,14 +1,19 @@ import Language.Haskell.LSP.Test -import Language.Haskell.LSP.TH.DataTypesJSON +import Language.Haskell.LSP.Types import Control.Monad.IO.Class main = runSession "hie --lsp" "test/recordings/renamePass" $ do docItem <- openDoc "Desktop/simple.hs" "haskell" + -- Use your favourite favourite combinators. + skipManyTill loggingNotification (count 2 publishDiagnosticsNotification) + + -- Send requests and notifications and receive responses let params = DocumentSymbolParams docItem - _ <- sendRequest TextDocumentDocumentSymbol params :: Session DocumentSymbolsResponse + 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