diff --git a/ghcide/src/Development/IDE/Core/Compile.hs b/ghcide/src/Development/IDE/Core/Compile.hs index f8fdcd36c42..91176eb6164 100644 --- a/ghcide/src/Development/IDE/Core/Compile.hs +++ b/ghcide/src/Development/IDE/Core/Compile.hs @@ -885,7 +885,8 @@ loadInterface -> (Maybe LinkableType -> m ([FileDiagnostic], Maybe HiFileResult)) -- ^ Action to regenerate an interface -> m ([FileDiagnostic], Maybe HiFileResult) loadInterface session ms sourceMod linkableNeeded regen = do - res <- liftIO $ checkOldIface session ms sourceMod Nothing + let sessionWithMsDynFlags = session{hsc_dflags = ms_hspp_opts ms} + res <- liftIO $ checkOldIface sessionWithMsDynFlags ms sourceMod Nothing case res of (UpToDate, Just iface) -- If the module used TH splices when it was last @@ -914,7 +915,7 @@ loadInterface session ms sourceMod linkableNeeded regen = do Just (LM obj_time _ _) -> obj_time > ms_hs_date ms if objUpToDate then do - hmi <- liftIO $ mkDetailsFromIface session iface linkable + hmi <- liftIO $ mkDetailsFromIface sessionWithMsDynFlags iface linkable return ([], Just $ HiFileResult ms hmi) else regen linkableNeeded (_reason, _) -> regen linkableNeeded