@@ -230,6 +230,7 @@ data IdeModeCommand = REPLCompletions String
230230 | PrintDef String
231231 | ErrString Err
232232 | ErrPPrint Err
233+ | GetIdrisVersion
233234
234235sexpToCommand :: SExp -> Maybe IdeModeCommand
235236sexpToCommand (SexpList (x:[])) = sexpToCommand x
@@ -275,6 +276,7 @@ sexpToCommand (SexpList [SymbolAtom "hide-term-implicits", StringAtom encoded])
275276sexpToCommand (SexpList [SymbolAtom "print-definition", StringAtom name]) = Just (PrintDef name)
276277sexpToCommand (SexpList [SymbolAtom "error-string", StringAtom encoded]) = Just . ErrString . decodeErr $ encoded
277278sexpToCommand (SexpList [SymbolAtom "error-pprint", StringAtom encoded]) = Just . ErrPPrint . decodeErr $ encoded
279+sexpToCommand (SymbolAtom "version") = Just GetIdrisVersion
278280sexpToCommand _ = Nothing
279281
280282parseMessage :: String -> Either Err (SExp, Integer)
@@ -298,5 +300,7 @@ convSExp pre s id =
298300getHexLength :: String -> String
299301getHexLength s = printf "%06x" (1 + (length s))
300302
303+-- | The version of the IDE mode command set. Increment this when you
304+-- change it so clients can adapt.
301305ideModeEpoch :: Int
302306ideModeEpoch = 1