@@ -308,8 +308,8 @@ runIdeSlaveCommand h id orig fn mods (IdeSlave.LoadFile filename toline) =
308308 clearErr
309309 putIState (orig { idris_options = idris_options i,
310310 idris_outputmode = (IdeSlave id h) })
311− loadInputs [filename] toline
312− isetPrompt (mkPrompt [filename])
311+ mods <- loadInputs [filename] toline
312+ isetPrompt (mkPrompt mods)
313313 -- Report either success or failure
314314 i <- getIState
315315 case (errSpan i) of
@@ -320,7 +320,7 @@ runIdeSlaveCommand h id orig fn mods (IdeSlave.LoadFile filename toline) =
320320 (idris_parsedSpan i)
321321 in runIO . hPutStrLn h $ IdeSlave.convSExp "return" msg id
322322 Just x -> iPrintError $ "didn't load " ++ filename
323− ideslave h orig [filename]
323+ ideslave h orig mods
324324runIdeSlaveCommand h id orig fn mods (IdeSlave.TypeOf name) =
325325 case splitName name of
326326 Left err -> iPrintError err
@@ -621,14 +621,14 @@ processInput cmd orig inputs
621621 }
622622 clearErr
623623 mods <- loadInputs inputs Nothing
624− return (Just inputs)
624+ return (Just mods)
625625 Success (Right (Load f toline)) ->
626626 do putIState orig { idris_options = idris_options i
627627 , idris_colourTheme = idris_colourTheme i
628628 }
629629 clearErr
630630 mod <- loadInputs [f] toline
631− return (Just [f])
631+ return (Just mod)
632632 Success (Right (ModImport f)) ->
633633 do clearErr
634634 fmod <- loadModule f
@@ -1328,7 +1328,7 @@ idris opts = do res <- runExceptT $ execStateT totalMain idrisInit
13281328 [] -> return ()
13291329
13301330
1331−loadInputs :: [FilePath] -> Maybe Int -> Idris ()
1331+loadInputs :: [FilePath] -> Maybe Int -> Idris [FilePath]
13321332loadInputs inputs toline -- furthest line to read in input source files
13331333 = idrisCatch
13341334 (do ist <- getIState
@@ -1357,7 +1357,7 @@ loadInputs inputs toline -- furthest line to read in input source files
13571357 when (not (all ibc ifiles) || loadCode) $
13581358 tryLoad False (filter (not . ibc) ifiles)
13591359 -- return the files that need rechecking
1360− return ifiles)
1360+ return (input, ifiles))
13611361 ninputs
13621362 inew <- getIState
13631363 let tidata = idris_tyinfodata inew
@@ -1366,7 +1366,7 @@ loadInputs inputs toline -- furthest line to read in input source files
13661366 case errSpan inew of
13671367 Nothing ->
13681368 do putIState (ist { idris_tyinfodata = tidata })
1369− ibcfiles <- mapM findNewIBC (nub (concat ifiles))
1369+ ibcfiles <- mapM findNewIBC (nub (concat (map snd ifiles)))
13701370 tryLoad True (mapMaybe id ibcfiles)
13711371 _ -> return ()
13721372 ist <- getIState
@@ -1377,7 +1377,7 @@ loadInputs inputs toline -- furthest line to read in input source files
13771377 [] -> performUsageAnalysis -- interactive
13781378 _ -> return [] -- batch, will be checked by the compiler
13791379
1380− return ())
1380+ return (map fst ifiles))
13811381 (\e -> do i <- getIState
13821382 case e of
13831383 At f e' -> do setErrSpan f
@@ -1386,7 +1386,8 @@ loadInputs inputs toline -- furthest line to read in input source files
13861386 _ -> do setErrSpan emptyFC -- FIXME! Propagate it
13871387 -- Issue #1576 on the issue tracker.
13881388 -- https://github.com/idris-lang/Idris-dev/issues/1576
1389− iWarn emptyFC $ pprintErr i e)
1389+ iWarn emptyFC $ pprintErr i e
1390+ return [])
13901391 where -- load all files, stop if any fail
13911392 tryLoad :: Bool -> [IFileType] -> Idris ()
13921393 tryLoad keepstate [] = warnTotality >> return ()
@@ -1532,7 +1533,7 @@ idrisMain opts =
15321533 iputStrLn banner
15331534
15341535 orig <- getIState
1535− when (not idesl) $ loadInputs inputs Nothing
1536+ mods <- if idesl then return [] else loadInputs inputs Nothing
15361537
15371538 runIO $ hSetBuffering stdout LineBuffering
15381539
@@ -1570,8 +1571,8 @@ idrisMain opts =
15701571
15711572 when (runrepl && not idesl) $ do
15721573-- clearOrigPats
1573− startServer port orig inputs
1574− runInputT (replSettings (Just historyFile)) $ repl orig inputs
1574+ startServer port orig mods
1575+ runInputT (replSettings (Just historyFile)) $ repl orig mods
15751576 let idesock = IdeslaveSocket `elem` opts
15761577 when (idesl) $ ideslaveStart idesock orig inputs
15771578 ok <- noErrors