From: Luke Lau Date: Mon, 9 Jul 2018 00:27:48 +0000 (+0100) Subject: Merge branch 'master' into script-fsm X-Git-Url: http://git.lukelau.me/?p=lsp-test.git;a=commitdiff_plain;h=fbb260c6078a39ff071fefd6586af18715b3e6a3 Merge branch 'master' into script-fsm --- fbb260c6078a39ff071fefd6586af18715b3e6a3 diff --cc haskell-lsp-test.cabal index 7deb60e,4a3c5ed..c5d1391 --- a/haskell-lsp-test.cabal +++ b/haskell-lsp-test.cabal @@@ -114,10 -71,9 +114,9 @@@ test-suite test , aeson , unordered-containers , text - other-modules: ParsingTests default-language: Haskell2010 -executable example +executable lsp-test-example hs-source-dirs: example main-is: Main.hs default-language: Haskell2010 diff --cc src/Language/Haskell/LSP/Test/Parsing.hs index 06776cb,3ecc538..88109a5 --- a/src/Language/Haskell/LSP/Test/Parsing.hs +++ b/src/Language/Haskell/LSP/Test/Parsing.hs @@@ -85,13 -85,10 +85,13 @@@ castMsg = fromMaybe (error "Failed cast -- | A version of encode that encodes FromServerMessages as if they -- weren't wrapped. encodeMsg :: FromServerMessage -> B.ByteString -encodeMsg = encode . genericToJSON (defaultOptions { sumEncoding = UntaggedValue }) +encodeMsg = encode . toJSONMsg + +toJSONMsg :: FromServerMessage -> Value +toJSONMsg = genericToJSON (defaultOptions { sumEncoding = UntaggedValue }) -- | Matches if the message is a log message notification or a show message notification/request. - loggingNotification :: (MonadIO m, MonadSessionConfig m) => ConduitParser FromServerMessage m FromServerMessage + loggingNotification :: Session FromServerMessage loggingNotification = named "Logging notification" $ satisfy shouldSkip where shouldSkip (NotLogMessage _) = True