Skip to content

Commit eb8240e

Browse files
committed
On cradle failure, register the hie.yaml file as a dependency
1 parent 1a34357 commit eb8240e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
329329
let res = (map (renderCradleError ncfp) err, Nothing)
330330
modifyVar_ fileToFlags $ \var -> do
331331
pure $ Map.insertWith HM.union hieYaml (HM.singleton ncfp (res, dep_info)) var
332-
return (res,[])
332+
return (res, maybe [] pure hieYaml ++ concatMap cradleErrorDependencies err)
333333

334334
-- This caches the mapping from hie.yaml + Mod.hs -> [String]
335335
-- Returns the Ghc session and the cradle dependencies
@@ -360,7 +360,7 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
360360
getOptions file = do
361361
hieYaml <- cradleLoc file
362362
sessionOpts (hieYaml, file) `catch` \e ->
363-
return (([renderPackageSetupException file e], Nothing),[])
363+
return (([renderPackageSetupException file e], Nothing), maybe [] pure hieYaml)
364364

365365
returnWithVersion $ \file -> do
366366
opts <- liftIO $ join $ mask_ $ modifyVar runningCradle $ \as -> do

0 commit comments

Comments
 (0)