projects
/
lsp-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Try caching now that v1.1 is out
[lsp-test.git]
/
src
/
Language
/
Haskell
/
LSP
/
Test
/
Parsing.hs
diff --git
a/src/Language/Haskell/LSP/Test/Parsing.hs
b/src/Language/Haskell/LSP/Test/Parsing.hs
index 52f97ae8e80a62da02e4614f5f00a5241cd5f175..5ce9b52995c05f0deb899c1327ae7476043760d2 100644
(file)
--- a/
src/Language/Haskell/LSP/Test/Parsing.hs
+++ b/
src/Language/Haskell/LSP/Test/Parsing.hs
@@
-6,6
+6,7
@@
module Language.Haskell.LSP.Test.Parsing
( -- $receiving
satisfy
module Language.Haskell.LSP.Test.Parsing
( -- $receiving
satisfy
+ , satisfyMaybe
, message
, anyRequest
, anyResponse
, message
, anyRequest
, anyResponse
@@
-23,7
+24,8
@@
import Control.Monad.IO.Class
import Control.Monad
import Data.Aeson
import qualified Data.ByteString.Lazy.Char8 as B
import Control.Monad
import Data.Aeson
import qualified Data.ByteString.Lazy.Char8 as B
-import Data.Conduit.Parser
+import Data.Conduit.Parser hiding (named)
+import qualified Data.Conduit.Parser (named)
import qualified Data.Text as T
import Data.Typeable
import Language.Haskell.LSP.Messages
import qualified Data.Text as T
import Data.Typeable
import Language.Haskell.LSP.Messages
@@
-81,7
+83,7
@@
satisfyMaybe pred = do
threadDelay (timeout * 1000000)
writeChan chan (TimeoutMessage timeoutId)
threadDelay (timeout * 1000000)
writeChan chan (TimeoutMessage timeoutId)
- x <- await
+ x <-
Session
await
unless skipTimeout $
modify $ \s -> s { curTimeoutId = timeoutId + 1 }
unless skipTimeout $
modify $ \s -> s { curTimeoutId = timeoutId + 1 }
@@
-94,6
+96,9
@@
satisfyMaybe pred = do
return a
Nothing -> empty
return a
Nothing -> empty
+named :: T.Text -> Session a -> Session a
+named s (Session x) = Session (Data.Conduit.Parser.named s x)
+
-- | Matches a message of type @a@.
message :: forall a. (Typeable a, FromJSON a) => Session a
message =
-- | Matches a message of type @a@.
message :: forall a. (Typeable a, FromJSON a) => Session a
message =