X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;ds=sidebyside;f=example%2FTest.hs;fp=example%2FTest.hs;h=0f5cdb46fea65960e8978677fb0d702cb30ae5e5;hb=fdef0cfe8916eb2e97ca0b5ae1c85e783b1c9172;hp=0000000000000000000000000000000000000000;hpb=d1855cd1182c51333c82bf964fc96c8ec3ec76b7;p=opengl.git diff --git a/example/Test.hs b/example/Test.hs new file mode 100644 index 0000000..0f5cdb4 --- /dev/null +++ b/example/Test.hs @@ -0,0 +1,19 @@ +import Control.Applicative.Combinators +import Control.Monad.IO.Class +import Language.Haskell.LSP.Test +import Language.Haskell.LSP.Types + +main = runSession "hie --lsp" fullCaps "../test/data/" $ do + docItem <- openDoc "Rename.hs" "haskell" + + -- Use your favourite favourite combinators. + skipManyTill loggingNotification (count 2 publishDiagnosticsNotification) + + -- Send requests and notifications and receive responses + let params = DocumentSymbolParams docItem + rsp <- request TextDocumentDocumentSymbol params :: Session DocumentSymbolsResponse + liftIO $ print rsp + + -- Or use one of the helper functions + getDocumentSymbols docItem >>= liftIO . print +