@@ -929,29 +929,29 @@ checkHieFile recorder se@ShakeExtras{withHieDb} tag hieFileLocation = do
929
929
-- Log that the HIE file does not exist where we expect that it should.
930
930
logHieFileMissing :: IO HieFileCheck
931
931
logHieFileMissing = do
932
- let log :: Log
933
- log = LogMissingHieFile hieFileLocation
934
- logWith recorder Logger. Debug log
932
+ let logMissing :: Log
933
+ logMissing = LogMissingHieFile hieFileLocation
934
+ logWith recorder Logger. Debug logMissing
935
935
pure HieFileMissing
936
936
-- When we know that the HIE file exists, check that it has not already
937
937
-- been indexed. If it hasn't, try to load it.
938
938
checkExistingHieFile :: IO HieFileCheck
939
939
checkExistingHieFile = do
940
- hash <- Util. getFileHash $ fromNormalizedFilePath hieFileLocation
941
- mrow <- withHieDb (\ hieDb -> HieDb. lookupHieFileFromHash hieDb hash )
940
+ hieFileHash <- Util. getFileHash $ fromNormalizedFilePath hieFileLocation
941
+ mrow <- withHieDb (\ hieDb -> HieDb. lookupHieFileFromHash hieDb hieFileHash )
942
942
dbHieFileLocation <- traverse (makeAbsolute . HieDb. hieModuleHieFile) mrow
943
- bool (tryLoadingHieFile hash ) (pure HieAlreadyIndexed ) $
943
+ bool (tryLoadingHieFile hieFileHash ) (pure HieAlreadyIndexed ) $
944
944
Just hieFileLocation == fmap toNormalizedFilePath' dbHieFileLocation
945
945
-- Attempt to load the HIE file, logging on failure (logging happens
946
946
-- in readHieFileFromDisk). If the file loads successfully, return
947
947
-- the data necessary for indexing it in the HieDb database.
948
948
tryLoadingHieFile :: Util. Fingerprint -> IO HieFileCheck
949
- tryLoadingHieFile hash = do
949
+ tryLoadingHieFile hieFileHash = do
950
950
ehf <- runIdeAction tag se $ runExceptT $
951
951
readHieFileFromDisk recorder hieFileLocation
952
952
pure $ case ehf of
953
953
Left err -> CouldNotLoadHie err
954
- Right hf -> DoIndexing hash hf
954
+ Right hf -> DoIndexing hieFileHash hf
955
955
956
956
-- | Check state of hiedb after loading an iface from disk - have we indexed the corresponding `.hie` file?
957
957
-- This function is responsible for ensuring database consistency
@@ -966,7 +966,7 @@ getModIfaceFromDiskAndIndexRule recorder =
966
966
-- doesn't need early cutoff since all its dependencies already have it
967
967
defineNoDiagnostics (cmapWithPrio LogShake recorder) $ \ GetModIfaceFromDiskAndIndex f -> do
968
968
x <- use_ GetModIfaceFromDisk f
969
- se@ ShakeExtras {withHieDb} <- getShakeExtras
969
+ se <- getShakeExtras
970
970
971
971
-- GetModIfaceFromDisk should have written a `.hie` file, must check if it matches version in db
972
972
let ms = hirModSummary x
@@ -985,9 +985,9 @@ getModIfaceFromDiskAndIndexRule recorder =
985
985
-- Uh oh, we failed to read the file for some reason, need to regenerate it
986
986
CouldNotLoadHie err -> hieFailure $ Just err
987
987
-- can just re-index the file we read from disk
988
- DoIndexing hash hf -> liftIO $ do
988
+ DoIndexing hieFileHash hf -> liftIO $ do
989
989
logWith recorder Logger. Debug $ LogReindexingHieFile f
990
- indexHieFile se hie_loc (HieDb. RealFile $ fromNormalizedFilePath f) hash hf
990
+ indexHieFile se hie_loc (HieDb. RealFile $ fromNormalizedFilePath f) hieFileHash hf
991
991
return (Just x)
992
992
993
993
newtype DisplayTHWarning = DisplayTHWarning (IO () )
0 commit comments