Commit 3c8b6348 authored by Andrew Gibiansky's avatar Andrew Gibiansky

Upgrading to v5 and making completion work

parent 9cd9cfb1
......@@ -15,8 +15,6 @@ import Data.Text (Text)
import qualified Data.ByteString.Lazy as Lazy
import IHaskell.IPython.Types
import Debug.Trace (traceShow)
type LByteString = Lazy.ByteString
----- External interface -----
......@@ -120,7 +118,7 @@ executeRequestParser content =
requestParser parser content = parsed
where
Success parsed = traceShow decoded $ parse parser decoded
Success parsed = parse parser decoded
Just decoded = decode content
historyRequestParser :: LByteString -> Message
......
......@@ -20,7 +20,7 @@ import IHaskell.IPython.Types
-- Convert message bodies into JSON.
instance ToJSON Message where
toJSON KernelInfoReply{ versionList = vers, language = language } = object [
"protocol_version" .= ints [4, 0], -- current protocol version, major and minor
"protocol_version" .= string "5.0", -- current protocol version, major and minor
"language_version" .= vers,
"language" .= language
]
......
......@@ -144,6 +144,7 @@ instance ToJSON MessageHeader where
"msg_id" .= messageId header,
"session" .= sessionId header,
"username" .= username header,
"version" .= ("5.0" :: String),
"msg_type" .= showMessageType (msgType header)
]
......
......@@ -217,7 +217,10 @@ completionType line loc target
| otherwise = last target
dots = intercalate "." . init
isModName = all isCapitalized (init target)
isCapitalized = isUpper . head
isCapitalized [] = False
isCapitalized (x:_) = isUpper x
lineUpToCursor = take loc line
fileComplete filePath = case parseShell lineUpToCursor of
Right xs -> filePath lineUpToCursor $
......
......@@ -65,7 +65,7 @@ parseFlags flags =
-- Treat no mode as 'console'.
if "--help" `elem` flags
then Left $ pack (showText (Wrap 100) $ helpText [] HelpFormatAll ihaskellArgs)
else process ihaskellArgs $ "console" : flags
else process ihaskellArgs flags
Just 0 -> process ihaskellArgs flags
Just idx ->
......
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