@@ -230,6 +230,7 @@ data IdeModeCommand = REPLCompletions String
230 | PrintDef String
230 | PrintDef String
231 | ErrString Err
231 | ErrString Err
232 | ErrPPrint Err
232 | ErrPPrint Err
234sexpToCommand :: SExp -> Maybe IdeModeCommand
235sexpToCommand :: SExp -> Maybe IdeModeCommand
235sexpToCommand (SexpList (x:[])) = sexpToCommand x
236sexpToCommand (SexpList (x:[])) = sexpToCommand x
@@ -275,6 +276,7 @@ sexpToCommand (SexpList [SymbolAtom "hide-term-implicits", StringAtom encoded])
275sexpToCommand (SexpList [SymbolAtom "print-definition", StringAtom name]) = Just (PrintDef name)
276sexpToCommand (SexpList [SymbolAtom "print-definition", StringAtom name]) = Just (PrintDef name)
276sexpToCommand (SexpList [SymbolAtom "error-string", StringAtom encoded]) = Just . ErrString . decodeErr $ encoded
277sexpToCommand (SexpList [SymbolAtom "error-string", StringAtom encoded]) = Just . ErrString . decodeErr $ encoded
277sexpToCommand (SexpList [SymbolAtom "error-pprint", StringAtom encoded]) = Just . ErrPPrint . decodeErr $ encoded
278sexpToCommand (SexpList [SymbolAtom "error-pprint", StringAtom encoded]) = Just . ErrPPrint . decodeErr $ encoded
279+sexpToCommand (SymbolAtom "version") = Just GetIdrisVersion
278sexpToCommand _ = Nothing
280sexpToCommand _ = Nothing
280parseMessage :: String -> Either Err (SExp, Integer)
282parseMessage :: String -> Either Err (SExp, Integer)
@@ -298,5 +300,7 @@ convSExp pre s id =
298getHexLength :: String -> String
300getHexLength :: String -> String
299getHexLength s = printf "%06x" (1 + (length s))
301getHexLength s = printf "%06x" (1 + (length s))
303+-- | The version of the IDE mode command set. Increment this when you
304+-- change it so clients can adapt.
301ideModeEpoch :: Int
305ideModeEpoch :: Int
302ideModeEpoch = 1
306ideModeEpoch = 1