Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
Find source for boot files
Browse files Browse the repository at this point in the history
  • Loading branch information
wz1000 committed Jul 12, 2020
1 parent 9272bfe commit d7cb09a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Development/IDE/Core/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ generateAndWriteHieFile hscEnv tcm =
dflags = hsc_dflags hscEnv
mod_summary = pm_mod_summary $ tm_parsed_module tcm
mod_location = ms_location mod_summary
targetPath = Compat.ml_hie_file mod_location
targetPath = withBootSuffix $ Compat.ml_hie_file mod_location
withBootSuffix = case ms_hsc_src mod_summary of
HsBootFile -> addBootSuffix
_ -> id

generateAndWriteHiFile :: HscEnv -> TcModuleResult -> IO [FileDiagnostic]
generateAndWriteHiFile hscEnv tc =
Expand Down
4 changes: 3 additions & 1 deletion src/Development/IDE/Core/Rules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ getHomeHieFile :: NormalizedFilePath -> MaybeT IdeAction HieFile
getHomeHieFile f = do
ms <- fst <$> useE GetModSummary f
let normal_hie_f = toNormalizedFilePath' hie_f
hie_f = ml_hie_file $ ms_location ms
hie_f = case ms_hsc_src ms of
HsBootFile -> addBootSuffix (ml_hie_file $ ms_location ms)
_ -> ml_hie_file $ ms_location ms

mbHieTimestamp <- either (\(_ :: IOException) -> Nothing) Just <$> (liftIO $ try $ getModificationTime hie_f)
srcTimestamp <- MaybeT (either (\(_ :: IOException) -> Nothing) Just <$> (liftIO $ try $ getModificationTime $ fromNormalizedFilePath f))
Expand Down

0 comments on commit d7cb09a

Please sign in to comment.