-import Language.Haskell.LSP.Test
-import Language.Haskell.LSP.TH.DataTypesJSON
-import Data.Proxy
-
+import Control.Applicative.Combinators
import Control.Monad.IO.Class
+import Language.Haskell.LSP.Test
+import Language.Haskell.LSP.Types
-main = runSession "hie" "test/recordings/renamePass" $ do
-
- docItem <- getDocItem "Desktop/simple.hs" "haskell"
- docId <- TextDocumentIdentifier <$> getDocUri "Desktop/simple.hs"
+main = runSession "hie --lsp" fullCaps "test/recordings/renamePass" $ do
+ docItem <- openDoc "Desktop/simple.hs" "haskell"
- sendNotification TextDocumentDidOpen (DidOpenTextDocumentParams docItem)
+ -- Use your favourite favourite combinators.
+ skipManyTill loggingNotification (count 2 publishDiagnosticsNotification)
- sendRequest (Proxy :: Proxy DocumentSymbolRequest) 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
- response >>= liftIO . print