projects
/
lsp-test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
cb75f57
)
Pretty print last received messages
author
Luke Lau
<luke_lau@icloud.com>
Tue, 26 Nov 2019 19:08:08 +0000
(19:08 +0000)
committer
Luke Lau
<luke_lau@icloud.com>
Tue, 26 Nov 2019 19:08:08 +0000
(19:08 +0000)
src/Language/Haskell/LSP/Test/Exceptions.hs
patch
|
blob
|
history
diff --git
a/src/Language/Haskell/LSP/Test/Exceptions.hs
b/src/Language/Haskell/LSP/Test/Exceptions.hs
index 88cf57d11ed6910391856ed85ffe9b244fcc5e26..713b25f101a23429668a1f29207e8f2c4a63645e 100644
(file)
--- a/
src/Language/Haskell/LSP/Test/Exceptions.hs
+++ b/
src/Language/Haskell/LSP/Test/Exceptions.hs
@@
-27,13
+27,13
@@
instance Show SessionException where
show (Timeout lastMsg) =
"Timed out waiting to receive a message from the server." ++
case lastMsg of
show (Timeout lastMsg) =
"Timed out waiting to receive a message from the server." ++
case lastMsg of
- Just msg -> "\nLast message received:
" ++ show msg
+ Just msg -> "\nLast message received:
\n" ++ B.unpack (encodePretty msg)
Nothing -> mempty
show NoContentLengthHeader = "Couldn't read Content-Length header from the server."
show (UnexpectedMessage expected lastMsg) =
"Received an unexpected message from the server:\n" ++
"Was parsing: " ++ expected ++ "\n" ++
Nothing -> mempty
show NoContentLengthHeader = "Couldn't read Content-Length header from the server."
show (UnexpectedMessage expected lastMsg) =
"Received an unexpected message from the server:\n" ++
"Was parsing: " ++ expected ++ "\n" ++
- "Last message received:
" ++ show lastMsg
+ "Last message received:
\n" ++ B.unpack (encodePretty lastMsg)
show (ReplayOutOfOrder received expected) =
let expected' = nub expected
getJsonDiff = lines . B.unpack . encodePretty
show (ReplayOutOfOrder received expected) =
let expected' = nub expected
getJsonDiff = lines . B.unpack . encodePretty