@@ -62,6 +62,7 @@ import Data.Time
62import Development.IDE.Types.SpanInfo
62import Development.IDE.Types.SpanInfo
63import GHC.Generics (Generic)
63import GHC.Generics (Generic)
64import System.FilePath
64import System.FilePath
65+import System.Directory
66-- | 'CoreModule' together with some additional information required for the
67-- | 'CoreModule' together with some additional information required for the
67-- conversion to DAML-LF.
68-- conversion to DAML-LF.
@@ -274,12 +275,14 @@ mkTcModuleResult (WriteInterface writeIface) tcm = do
274 nc <- liftIO $ readIORef (hsc_NC session)
275 nc <- liftIO $ readIORef (hsc_NC session)
275 (iface,_) <- liftIO $ mkIfaceTc session Nothing Sf_None details tcGblEnv
276 (iface,_) <- liftIO $ mkIfaceTc session Nothing Sf_None details tcGblEnv
276 liftIO $ when writeIface $ do
277 liftIO $ when writeIface $ do
278+ let path = ".interfaces" </> file tcm
279+ createDirectoryIfMissing True (takeDirectory path)
277− writeIfaceFile (hsc_dflags session) (replaceExtension (file tcm) ".hi") iface
280+ writeIfaceFile (hsc_dflags session) (replaceExtension path ".hi") iface
278 -- For now, we write .hie files whenever we write .hi files which roughly corresponds to
281 -- For now, we write .hie files whenever we write .hi files which roughly corresponds to
279 -- when we are building a package. It should be easily decoupable if that turns out to be
282 -- when we are building a package. It should be easily decoupable if that turns out to be
280 -- useful.
283 -- useful.
281 hieFile <- runHsc session $ mkHieFile (tcModSummary tcm) tcGblEnv (fromJust $ renamedSource tcm)
284 hieFile <- runHsc session $ mkHieFile (tcModSummary tcm) tcGblEnv (fromJust $ renamedSource tcm)
282− writeHieFile (replaceExtension (file tcm) ".hie") hieFile
285+ writeHieFile (replaceExtension path ".hie") hieFile
283 let mod_info = HomeModInfo iface details Nothing
286 let mod_info = HomeModInfo iface details Nothing
284 origNc = nsNames nc
287 origNc = nsNames nc
285 case lookupModuleEnv origNc (tcmModule tcm) of
288 case lookupModuleEnv origNc (tcmModule tcm) of