projects
/
opengl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add nicer API
[opengl.git]
/
example
/
Main.hs
diff --git
a/example/Main.hs
b/example/Main.hs
index 5aaa2d13abee6adb516dcfece381e3cd215d1e50..cc74026531ead6183d384d9113fd001a8f60e510 100644
(file)
--- a/
example/Main.hs
+++ b/
example/Main.hs
@@
-1,17
+1,14
@@
import Language.Haskell.LSP.Test
import Language.Haskell.LSP.TH.DataTypesJSON
import Language.Haskell.LSP.Test
import Language.Haskell.LSP.TH.DataTypesJSON
-import Data.Proxy
import Control.Monad.IO.Class
import Control.Monad.IO.Class
-main = runSession "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"
+ let params = DocumentSymbolParams docItem
+ _ <- sendRequest TextDocumentDocumentSymbol params :: Session DocumentSymbolsResponse
- s
endNotification TextDocumentDidOpen (DidOpenTextDocumentParams docItem)
+ s
kipMany loggingNotification
- sendRequest (Proxy :: Proxy DocumentSymbolRequest) TextDocumentDocumentSymbol (DocumentSymbolParams docId)
-
- syms <- getMessage :: Session DocumentSymbolsResponse
- liftIO $ print syms
\ No newline at end of file
+ anyResponse >>= liftIO . print