X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=example%2FMain.hs;h=0318ce8c04f47243f3946bd1d755c336cc08e3e7;hb=0e9ea704c2fd5ab6c762e709b4a4ad4b10169a7e;hp=4891c6c12219cf34d85b1b23bb1a303cbb17bd6f;hpb=22df37c703e39fa5ebeb130be5785b3a9713c520;p=lsp-test.git diff --git a/example/Main.hs b/example/Main.hs index 4891c6c..0318ce8 100644 --- a/example/Main.hs +++ b/example/Main.hs @@ -1,13 +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" - sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams docItem) + -- Use your favourite favourite combinators. + skipManyTill loggingNotification (count 2 publishDiagnosticsNotification) - skipMany loggingNotification + -- Send requests and notifications and receive responses + let params = DocumentSymbolParams docItem + response <- sendRequest TextDocumentDocumentSymbol params :: Session DocumentSymbolsResponse + liftIO $ print response + + -- Or use one of the helper functions + getDocumentSymbols docItem >>= liftIO . print - anyResponse >>= liftIO . print