Skip to content

Commit 40e68d2

Browse files
committed
Update isInterface and resetInterfaceStore with @wz1000 feedback
1 parent 0e71043 commit 40e68d2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

ghcide/src/Development/IDE/Core/FileStore.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,13 @@ getModificationTimeRule vfs isWatched =
128128
-- But interface files are private, in that only HLS writes them.
129129
-- So we implement watching ourselves, and bypass the need for alwaysRerun.
130130
isInterface :: NormalizedFilePath -> Bool
131-
isInterface f = takeExtension (fromNormalizedFilePath f) `elem` [".hi", ".hie"]
131+
isInterface f = takeExtension (fromNormalizedFilePath f) `elem` [".hi", ".hi-boot"]
132132

133133
-- | Reset the GetModificationTime state of interface files
134-
resetInterfaceStore :: ShakeExtras -> FilePath -> IO ()
134+
resetInterfaceStore :: ShakeExtras -> NormalizedFilePath -> IO ()
135135
resetInterfaceStore state f = do
136-
forM_ [toNormalizedFilePath' (replaceExtension f ext) | ext <- ["hi","hie"]] $ \f ->
137-
forM_ [True,False] $ \gmt ->
138-
deleteValue state (GetModificationTime_ gmt) f
136+
deleteValue state (GetModificationTime_ True) f
137+
deleteValue state (GetModificationTime_ False) f
139138

140139
-- | Reset the GetModificationTime state of watched files
141140
resetFileStore :: IdeState -> [FileEvent] -> IO ()

ghcide/src/Development/IDE/Core/Rules.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ writeHiFileAction hsc hiFile = do
10951095
extras <- getShakeExtras
10961096
let targetPath = ml_hi_file $ ms_location $ hirModSummary hiFile
10971097
liftIO $ do
1098-
resetInterfaceStore extras targetPath
1098+
resetInterfaceStore extras $ toNormalizedFilePath' targetPath
10991099
writeHiFile hsc hiFile
11001100

11011101
-- | A rule that wires per-file rules together

0 commit comments

Comments
 (0)