projects
/
lsp-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade stack to lts-12.0
[lsp-test.git]
/
example
/
Main.hs
diff --git
a/example/Main.hs
b/example/Main.hs
index fc453db39cdb032a98cb0c468e697167816458cf..0318ce8c04f47243f3946bd1d755c336cc08e3e7 100644
(file)
--- a/
example/Main.hs
+++ b/
example/Main.hs
@@
-1,18
+1,19
@@
import Language.Haskell.LSP.Test
import Language.Haskell.LSP.Test
-import Language.Haskell.LSP.TH.DataTypesJSON
-import Data.Proxy
+import Language.Haskell.LSP.Types
import Control.Monad.IO.Class
import Control.Monad.IO.Class
-main = runSession "hie" "test/recordings/renamePass" $ do
+main = runSession "hie --lsp" "test/recordings/renamePass" $ do
+ docItem <- openDoc "Desktop/simple.hs" "haskell"
- docItem <- getDocItem "Desktop/simple.hs" "haskell"
- docId <- TextDocumentIdentifier <$> getDocUri "Desktop/simple.hs"
+ -- Use your favourite favourite combinators.
+ skipManyTill loggingNotification (count 2 publishDiagnosticsNotification)
- sendNotification TextDocumentDidOpen (DidOpenTextDocumentParams docItem)
+ -- Send requests and notifications and receive responses
+ let params = DocumentSymbolParams docItem
+ response <- sendRequest TextDocumentDocumentSymbol params :: Session DocumentSymbolsResponse
+ liftIO $ print response
- sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams docId)
+ -- Or use one of the helper functions
+ getDocumentSymbols docItem >>= liftIO . print
- skipMany loggingNotification
-
- anyResponse >>= liftIO . print