Remove writeIfacesAndHie (#112)

This function is never used in ghcide so it makes more sense to have
it be part of the `daml` source code since we depend on this for
building the `.dar` archives.
This commit is contained in:
Moritz Kiefer 2019-09-23 12:55:33 +02:00 committed by GitHub
parent c24ef1c288
commit 79301b472e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,6 @@ module Development.IDE.Core.Rules(
getDependencies,
getParsedModule,
fileFromParsedModule,
writeIfacesAndHie,
) where
import Control.Monad.Except
@ -128,39 +127,6 @@ getDefinition file pos = fmap join $ runMaybeT $ do
getParsedModule :: NormalizedFilePath -> Action (Maybe ParsedModule)
getParsedModule file = use GetParsedModule file
-- | Write interface files and hie files to the location specified by the given options.
writeIfacesAndHie ::
NormalizedFilePath -> [NormalizedFilePath] -> Action (Maybe [NormalizedFilePath])
writeIfacesAndHie ifDir files =
runMaybeT $ do
tcms <- usesE TypeCheck files
fmap concat $ forM (zip files tcms) $ \(file, tcm) -> do
session <- lift $ hscEnv <$> use_ GhcSession file
liftIO $ writeTcm session tcm
where
writeTcm session tcm =
do
let fp =
fromNormalizedFilePath ifDir </>
(ms_hspp_file $
pm_mod_summary $ tm_parsed_module $ tmrModule tcm)
createDirectoryIfMissing True (takeDirectory fp)
let ifaceFp = replaceExtension fp ".hi"
let hieFp = replaceExtension fp ".hie"
writeIfaceFile
(hsc_dflags session)
ifaceFp
(hm_iface $ tmrModInfo tcm)
hieFile <-
liftIO $
runHsc session $
mkHieFile
(pm_mod_summary $ tm_parsed_module $ tmrModule tcm)
(fst $ tm_internals_ $ tmrModule tcm)
(fromJust $ tm_renamed_source $ tmrModule tcm)
writeHieFile hieFp hieFile
pure [toNormalizedFilePath ifaceFp, toNormalizedFilePath hieFp]
------------------------------------------------------------
-- Rules
-- These typically go from key to value and are oracles.