projects
/
opengl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reexport modules via cabal
[opengl.git]
/
example
/
Main.hs
diff --git
a/example/Main.hs
b/example/Main.hs
index cc74026531ead6183d384d9113fd001a8f60e510..c992b8ea67390760497b6fdee187078c428489a8 100644
(file)
--- a/
example/Main.hs
+++ b/
example/Main.hs
@@
-1,14
+1,19
@@
-import Language.Haskell.LSP.Test
-import Language.Haskell.LSP.TH.DataTypesJSON
-
+import Control.Applicative.Combinators
import Control.Monad.IO.Class
import Control.Monad.IO.Class
+import Language.Haskell.LSP.Test
+import Language.Haskell.LSP.Types
main = runSession "hie --lsp" "test/recordings/renamePass" $ do
docItem <- openDoc "Desktop/simple.hs" "haskell"
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
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