@@ -82,8 +82,17 @@ repl orig mods
82 repl orig mods
82 repl orig mods
84-- | Run the IdeSlave
84-- | Run the IdeSlave
85+ideslaveStart :: [FilePath] -> Idris ()
88+ case idris_outputmode i of
90+ when (mods /= []) (do liftIO $ putStrLn $ convSExp "set-prompt" (mkPrompt mods) n)
85−ideslave :: IState -> [FilePath] -> Idris ()
94+ideslave :: [FilePath] -> Idris ()
86−ideslave orig mods
95+ideslave mods
87 = do idrisCatch
96 = do idrisCatch
88 (do l <- liftIO $ getLine
97 (do l <- liftIO $ getLine
89 let (sexp, id) = receiveMessage l
98 let (sexp, id) = receiveMessage l
@@ -106,10 +115,12 @@ ideslave orig mods
106 liftIO $ putStrLn $ sendMessage id (Right (map replacement compls, reverse unused))
115 liftIO $ putStrLn $ sendMessage id (Right (map replacement compls, reverse unused))
107 Just (LoadFile filename) -> do clearErr
116 Just (LoadFile filename) -> do clearErr
108 mod <- loadModule filename
117 mod <- loadModule filename
118+ liftIO $ putStrLn $ convSExp "set-prompt" (mkPrompt [filename]) id
109 liftIO $ putStrLn $ sendMessage id (Right (SymbolAtom "good"))
119 liftIO $ putStrLn $ sendMessage id (Right (SymbolAtom "good"))
110 Nothing -> do liftIO $ putStrLn $ sendMessage id (Left "did not understand"))
121 Nothing -> do liftIO $ putStrLn $ sendMessage id (Left "did not understand"))
111 (\e -> do liftIO $ putStrLn $ sendMessage 0 (Left (show e)))
122 (\e -> do liftIO $ putStrLn $ sendMessage 0 (Left (show e)))
112− ideslave orig mods
123+ ideslave mods
114-- | The prompt consists of the currently loaded modules, or "Idris" if there are none
125-- | The prompt consists of the currently loaded modules, or "Idris" if there are none
115mkPrompt [] = "Idris"
126mkPrompt [] = "Idris"
@@ -611,7 +622,7 @@ idrisMain opts =
611 [] -> return ()
622 [] -> return ()
612 (o:_) -> process "" (NewCompile o)
623 (o:_) -> process "" (NewCompile o)
613 when (runrepl && not idesl) $ runInputT replSettings $ repl ist inputs
624 when (runrepl && not idesl) $ runInputT replSettings $ repl ist inputs
614− when (idesl) $ ideslave ist inputs
625+ when (idesl) $ ideslaveStart inputs
615 ok <- noErrors
626 ok <- noErrors
616 when (not ok) $ liftIO (exitWith (ExitFailure 1))
627 when (not ok) $ liftIO (exitWith (ExitFailure 1))