Commit c10f3e08 authored by MMesch's avatar MMesch

add status to all Reply messages

parent d5b56fbb
...@@ -177,6 +177,7 @@ replyTo config _ interface KernelInfoRequest{} replyHeader = do ...@@ -177,6 +177,7 @@ replyTo config _ interface KernelInfoRequest{} replyHeader = do
, implementationVersion = kernelImplVersion config , implementationVersion = kernelImplVersion config
, banner = kernelBanner config , banner = kernelBanner config
, protocolVersion = kernelProtocolVersion config , protocolVersion = kernelProtocolVersion config
, status = Ok
} }
replyTo config _ _ CommInfoRequest{} replyHeader = replyTo config _ _ CommInfoRequest{} replyHeader =
......
...@@ -31,6 +31,7 @@ instance ToJSON Message where ...@@ -31,6 +31,7 @@ instance ToJSON Message where
, "implementation" .= implementation rep , "implementation" .= implementation rep
, "implementation_version" .= implementationVersion rep , "implementation_version" .= implementationVersion rep
, "language_info" .= languageInfo rep , "language_info" .= languageInfo rep
, "status" .= show (status rep)
] ]
toJSON CommInfoReply toJSON CommInfoReply
...@@ -38,7 +39,9 @@ instance ToJSON Message where ...@@ -38,7 +39,9 @@ instance ToJSON Message where
, commInfo = commInfo , commInfo = commInfo
} = } =
object object
[ "comms" .= Map.map (\comm -> object ["target_name" .= comm]) commInfo ] [ "comms" .= Map.map (\comm -> object ["target_name" .= comm]) commInfo
, "status" .= string "ok"
]
toJSON ExecuteRequest toJSON ExecuteRequest
{ getCode = code { getCode = code
...@@ -109,7 +112,9 @@ instance ToJSON Message where ...@@ -109,7 +112,9 @@ instance ToJSON Message where
] ]
toJSON ShutdownReply { restartPending = restart } = toJSON ShutdownReply { restartPending = restart } =
object ["restart" .= restart] object ["restart" .= restart
, "status" .= string "ok"
]
toJSON ClearOutput { wait = wait } = toJSON ClearOutput { wait = wait } =
object ["wait" .= wait] object ["wait" .= wait]
...@@ -132,7 +137,9 @@ instance ToJSON Message where ...@@ -132,7 +137,9 @@ instance ToJSON Message where
object ["comm_id" .= commUuid req, "data" .= commData req] object ["comm_id" .= commUuid req, "data" .= commData req]
toJSON req@HistoryReply{} = toJSON req@HistoryReply{} =
object ["history" .= map tuplify (historyReply req)] object ["history" .= map tuplify (historyReply req)
, "status" .= string "ok"
]
where where
tuplify (HistoryReplyElement sess linum res) = (sess, linum, case res of tuplify (HistoryReplyElement sess linum res) = (sess, linum, case res of
Left inp -> toJSON inp Left inp -> toJSON inp
......
...@@ -299,6 +299,7 @@ data Message = ...@@ -299,6 +299,7 @@ data Message =
, implementation :: String -- ^ e.g. IHaskell , implementation :: String -- ^ e.g. IHaskell
, implementationVersion :: String -- ^ The version of the implementation , implementationVersion :: String -- ^ The version of the implementation
, languageInfo :: LanguageInfo , languageInfo :: LanguageInfo
, status :: ExecuteReplyStatus
} }
| |
-- | A request from a frontend for information about the comms. -- | A request from a frontend for information about the comms.
......
...@@ -275,6 +275,7 @@ replyTo interface KernelInfoRequest{} replyHeader state = do ...@@ -275,6 +275,7 @@ replyTo interface KernelInfoRequest{} replyHeader state = do
, languageFileExtension = ".hs" , languageFileExtension = ".hs"
, languageCodeMirrorMode = "ihaskell" , languageCodeMirrorMode = "ihaskell"
} }
, status = Ok
}) })
replyTo _ CommInfoRequest{} replyHeader state = replyTo _ CommInfoRequest{} replyHeader state =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment