projects
/
lsp-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add logColor config option
[lsp-test.git]
/
example
/
Main.hs
diff --git
a/example/Main.hs
b/example/Main.hs
index 29795fa22e52b76279d1ae98eca5c5f111eb72cd..7ee3f92cd414db960a5b14d98d3804d1745c6995 100644
(file)
--- a/
example/Main.hs
+++ b/
example/Main.hs
@@
-1,18
+1,19
@@
-import Language.Haskell.LSP.Test
-import Language.Haskell.LSP.TH.DataTypesJSON
-import Data.Proxy
-
+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 <- getDocItem "Desktop/simple.hs" "haskell"
- docId <- TextDocumentIdentifier <$> getDocUri "Desktop/simple.hs"
+main = runSession "hie --lsp" fullCaps "test/data/renamePass" $ do
+ docItem <- openDoc "Desktop/simple.hs" "haskell"
- sendNotification TextDocumentDidOpen (DidOpenTextDocumentParams docItem)
+ -- Use your favourite favourite combinators.
+ skipManyTill loggingNotification (count 2 publishDiagnosticsNotification)
- sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams docId)
+ -- Send requests and notifications and receive responses
+ let params = DocumentSymbolParams docItem
+ 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