on master help sign in
Fix marshalling of String/Symbol (broke completion)
4343d42Hannes Mehnert
src/Idris/IdeSlave.hs+4−2
@@ -26,13 +26,15 @@ sExpToString (List l) = "(" ++ intercalate " " (map sExpToString l) ++ "
26class SExpable a where
26class SExpable a where
27 toSExp :: a -> SExp
27 toSExp :: a -> SExp
28
28
29+instance SExpable SExp where
30+ toSExp a = a
31+
29instance SExpable Bool where
32instance SExpable Bool where
30 toSExp True = BoolAtom True
33 toSExp True = BoolAtom True
31 toSExp False = BoolAtom False
34 toSExp False = BoolAtom False
32
35
33instance SExpable String where
36instance SExpable String where
34− toSExp (':' : xs) = SymbolAtom xs
35− toSExp s = StringAtom s
37+ toSExp s = StringAtom s
36
38
37instance SExpable Integer where
39instance SExpable Integer where
38 toSExp n = IntegerAtom n
40 toSExp n = IntegerAtom n
src/Idris/REPL.hs+1−1
@@ -103,7 +103,7 @@ ideslave orig mods
103 liftIO $ sendMessage id (Right (map replacement compls, reverse unused))
103 liftIO $ sendMessage id (Right (map replacement compls, reverse unused))
104 Just (LoadFile filename) -> do clearErr
104 Just (LoadFile filename) -> do clearErr
105 mod <- loadModule filename
105 mod <- loadModule filename
106− liftIO $ sendMessage id (Right ":good")
106+ liftIO $ sendMessage id (Right (SymbolAtom ":good"))
107 Nothing -> do liftIO $ sendMessage id (Left "did not understand"))
107 Nothing -> do liftIO $ sendMessage id (Left "did not understand"))
108 (\e -> do liftIO $ sendMessage 0 (Left (show e)))
108 (\e -> do liftIO $ sendMessage 0 (Left (show e)))
109 ideslave orig mods
109 ideslave orig mods