9d1fc0bd36eca2068de6cf8f2e08c854c9faa74f
[lsp-test.git] / example / Test.hs
1 import Control.Applicative.Combinators
2 import Control.Monad.IO.Class
3 import Language.Haskell.LSP.Test
4 import Language.Haskell.LSP.Types
5
6 main = runSession "haskell-language-server" fullCaps "../test/data/" $ do
7   doc <- openDoc "Rename.hs" "haskell"
8   
9   -- Use your favourite favourite combinators.
10   skipManyTill loggingNotification (count 2 publishDiagnosticsNotification)
11
12   -- Send requests and notifications and receive responses
13   rsp <- request STextDocumentDocumentSymbol $
14           DocumentSymbolParams Nothing Nothing doc
15   liftIO $ print rsp
16
17   -- Or use one of the helper functions
18   getDocumentSymbols doc >>= liftIO . print
19