mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-16 19:36:06 +00:00
add status to all Reply messages
This commit is contained in:
parent
d5b56fbb51
commit
c10f3e085b
@ -177,6 +177,7 @@ replyTo config _ interface KernelInfoRequest{} replyHeader = do
|
||||
, implementationVersion = kernelImplVersion config
|
||||
, banner = kernelBanner config
|
||||
, protocolVersion = kernelProtocolVersion config
|
||||
, status = Ok
|
||||
}
|
||||
|
||||
replyTo config _ _ CommInfoRequest{} replyHeader =
|
||||
|
@ -31,6 +31,7 @@ instance ToJSON Message where
|
||||
, "implementation" .= implementation rep
|
||||
, "implementation_version" .= implementationVersion rep
|
||||
, "language_info" .= languageInfo rep
|
||||
, "status" .= show (status rep)
|
||||
]
|
||||
|
||||
toJSON CommInfoReply
|
||||
@ -38,7 +39,9 @@ instance ToJSON Message where
|
||||
, commInfo = commInfo
|
||||
} =
|
||||
object
|
||||
[ "comms" .= Map.map (\comm -> object ["target_name" .= comm]) commInfo ]
|
||||
[ "comms" .= Map.map (\comm -> object ["target_name" .= comm]) commInfo
|
||||
, "status" .= string "ok"
|
||||
]
|
||||
|
||||
toJSON ExecuteRequest
|
||||
{ getCode = code
|
||||
@ -109,7 +112,9 @@ instance ToJSON Message where
|
||||
]
|
||||
|
||||
toJSON ShutdownReply { restartPending = restart } =
|
||||
object ["restart" .= restart]
|
||||
object ["restart" .= restart
|
||||
, "status" .= string "ok"
|
||||
]
|
||||
|
||||
toJSON ClearOutput { wait = wait } =
|
||||
object ["wait" .= wait]
|
||||
@ -132,7 +137,9 @@ instance ToJSON Message where
|
||||
object ["comm_id" .= commUuid req, "data" .= commData req]
|
||||
|
||||
toJSON req@HistoryReply{} =
|
||||
object ["history" .= map tuplify (historyReply req)]
|
||||
object ["history" .= map tuplify (historyReply req)
|
||||
, "status" .= string "ok"
|
||||
]
|
||||
where
|
||||
tuplify (HistoryReplyElement sess linum res) = (sess, linum, case res of
|
||||
Left inp -> toJSON inp
|
||||
|
@ -299,6 +299,7 @@ data Message =
|
||||
, implementation :: String -- ^ e.g. IHaskell
|
||||
, implementationVersion :: String -- ^ The version of the implementation
|
||||
, languageInfo :: LanguageInfo
|
||||
, status :: ExecuteReplyStatus
|
||||
}
|
||||
|
|
||||
-- | A request from a frontend for information about the comms.
|
||||
|
@ -275,6 +275,7 @@ replyTo interface KernelInfoRequest{} replyHeader state = do
|
||||
, languageFileExtension = ".hs"
|
||||
, languageCodeMirrorMode = "ihaskell"
|
||||
}
|
||||
, status = Ok
|
||||
})
|
||||
|
||||
replyTo _ CommInfoRequest{} replyHeader state =
|
||||
|
Loading…
x
Reference in New Issue
Block a user