Actually update world
in legacyInteractiveLoop
This commit is contained in:
parent
ce1d9d1da1
commit
64379a7c56
@ -69,8 +69,13 @@ initSession :: IOish m
|
|||||||
initSession opts mdf = do
|
initSession opts mdf = do
|
||||||
s <- gmsGet
|
s <- gmsGet
|
||||||
case gmGhcSession s of
|
case gmGhcSession s of
|
||||||
Just GmGhcSession {..} -> when (gmgsOptions /= opts) $ putNewSession s
|
Just GmGhcSession {..} | gmgsOptions /= opts-> do
|
||||||
Nothing -> putNewSession s
|
gmLog GmDebug "initSession" $ text "Flags changed, creating new session"
|
||||||
|
putNewSession s
|
||||||
|
Just _ -> return ()
|
||||||
|
Nothing -> do
|
||||||
|
gmLog GmDebug "initSession" $ text "Session not initialized, creating new one"
|
||||||
|
putNewSession s
|
||||||
|
|
||||||
where
|
where
|
||||||
putNewSession s = do
|
putNewSession s = do
|
||||||
|
@ -462,6 +462,11 @@ legacyInteractiveLoop symdbreq world = do
|
|||||||
-- after blocking, we need to see if the world has changed.
|
-- after blocking, we need to see if the world has changed.
|
||||||
|
|
||||||
changed <- didWorldChange world
|
changed <- didWorldChange world
|
||||||
|
|
||||||
|
world' <- if changed
|
||||||
|
then getCurrentWorld -- TODO: gah, we're hitting the fs twice
|
||||||
|
else return world
|
||||||
|
|
||||||
when changed $ do
|
when changed $ do
|
||||||
dropSession
|
dropSession
|
||||||
|
|
||||||
@ -500,7 +505,7 @@ legacyInteractiveLoop symdbreq world = do
|
|||||||
_ -> fatalError $ "unknown command: `" ++ cmd ++ "'"
|
_ -> fatalError $ "unknown command: `" ++ cmd ++ "'"
|
||||||
|
|
||||||
gmPutStr res >> gmPutStrLn "OK" >> liftIO (hFlush stdout)
|
gmPutStr res >> gmPutStrLn "OK" >> liftIO (hFlush stdout)
|
||||||
legacyInteractiveLoop symdbreq world
|
legacyInteractiveLoop symdbreq world'
|
||||||
where
|
where
|
||||||
interactiveHandlers =
|
interactiveHandlers =
|
||||||
[ GHandler $ \e@(FatalError _) -> throw e
|
[ GHandler $ \e@(FatalError _) -> throw e
|
||||||
|
Loading…
Reference in New Issue
Block a user