mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-17 23:22:04 +03:00
language: fix: move interface files to a different (#1074)
* language: fix: move interface files to a different This fixes https://github.com/digital-asset/daml/issues/1009. We move the created interface files and hie files to a hidden directory ".interfaces" when creating a package. * removing the ifaceDir option and hardcode the dir
This commit is contained in:
parent
0ac72a4340
commit
160554ac95
@ -62,6 +62,7 @@ import Data.Time
|
|||||||
import Development.IDE.Types.SpanInfo
|
import Development.IDE.Types.SpanInfo
|
||||||
import GHC.Generics (Generic)
|
import GHC.Generics (Generic)
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
|
import System.Directory
|
||||||
|
|
||||||
-- | 'CoreModule' together with some additional information required for the
|
-- | 'CoreModule' together with some additional information required for the
|
||||||
-- conversion to DAML-LF.
|
-- conversion to DAML-LF.
|
||||||
@ -274,12 +275,14 @@ mkTcModuleResult (WriteInterface writeIface) tcm = do
|
|||||||
nc <- liftIO $ readIORef (hsc_NC session)
|
nc <- liftIO $ readIORef (hsc_NC session)
|
||||||
(iface,_) <- liftIO $ mkIfaceTc session Nothing Sf_None details tcGblEnv
|
(iface,_) <- liftIO $ mkIfaceTc session Nothing Sf_None details tcGblEnv
|
||||||
liftIO $ when writeIface $ do
|
liftIO $ when writeIface $ do
|
||||||
writeIfaceFile (hsc_dflags session) (replaceExtension (file tcm) ".hi") iface
|
let path = ".interfaces" </> file tcm
|
||||||
|
createDirectoryIfMissing True (takeDirectory path)
|
||||||
|
writeIfaceFile (hsc_dflags session) (replaceExtension path ".hi") iface
|
||||||
-- For now, we write .hie files whenever we write .hi files which roughly corresponds to
|
-- For now, we write .hie files whenever we write .hi files which roughly corresponds to
|
||||||
-- when we are building a package. It should be easily decoupable if that turns out to be
|
-- when we are building a package. It should be easily decoupable if that turns out to be
|
||||||
-- useful.
|
-- useful.
|
||||||
hieFile <- runHsc session $ mkHieFile (tcModSummary tcm) tcGblEnv (fromJust $ renamedSource tcm)
|
hieFile <- runHsc session $ mkHieFile (tcModSummary tcm) tcGblEnv (fromJust $ renamedSource tcm)
|
||||||
writeHieFile (replaceExtension (file tcm) ".hie") hieFile
|
writeHieFile (replaceExtension path ".hie") hieFile
|
||||||
let mod_info = HomeModInfo iface details Nothing
|
let mod_info = HomeModInfo iface details Nothing
|
||||||
origNc = nsNames nc
|
origNc = nsNames nc
|
||||||
case lookupModuleEnv origNc (tcmModule tcm) of
|
case lookupModuleEnv origNc (tcmModule tcm) of
|
||||||
|
Loading…
Reference in New Issue
Block a user