From a76d3b82f1251c1194d2fc77034e521d642810d9 Mon Sep 17 00:00:00 2001 From: Nicholas Luo Date: Tue, 9 Feb 2016 22:26:13 +0800 Subject: [PATCH] Combine protocol version with rest of kernel info --- ipython-kernel/src/IHaskell/IPython/Message/Writer.hs | 2 +- ipython-kernel/src/IHaskell/IPython/Types.hs | 1 + main/Main.hs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ipython-kernel/src/IHaskell/IPython/Message/Writer.hs b/ipython-kernel/src/IHaskell/IPython/Message/Writer.hs index 40cd337d..756d6a13 100644 --- a/ipython-kernel/src/IHaskell/IPython/Message/Writer.hs +++ b/ipython-kernel/src/IHaskell/IPython/Message/Writer.hs @@ -25,7 +25,7 @@ instance ToJSON LanguageInfo where instance ToJSON Message where toJSON rep@KernelInfoReply{} = object - [ "protocol_version" .= string "5.0" -- current protocol version, major and minor + [ "protocol_version" .= protocolVersion rep , "banner" .= banner rep , "implementation" .= implementation rep , "implementation_version" .= implementationVersion rep diff --git a/ipython-kernel/src/IHaskell/IPython/Types.hs b/ipython-kernel/src/IHaskell/IPython/Types.hs index dab763bd..3359d0bf 100644 --- a/ipython-kernel/src/IHaskell/IPython/Types.hs +++ b/ipython-kernel/src/IHaskell/IPython/Types.hs @@ -287,6 +287,7 @@ data Message = -- | A response to a KernelInfoRequest. KernelInfoReply { header :: MessageHeader + , protocolVersion :: String -- ^ current protocol version, major and minor , banner :: String -- ^ Kernel information description e.g. (IHaskell 0.8.3.0 GHC 7.10.2) , implementation :: String -- ^ e.g. IHaskell , implementationVersion :: String -- ^ The version of the implementation diff --git a/main/Main.hs b/main/Main.hs index f0cd724b..98b55420 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -239,6 +239,7 @@ replyTo _ KernelInfoRequest{} replyHeader state = return (state, KernelInfoReply { header = replyHeader + , protocolVersion = "5.0" , banner = "IHaskell " ++ VERSION_ipython_kernel ++ " GHC " ++ VERSION_ghc , implementation = "IHaskell" , implementationVersion = VERSION_ipython_kernel