Skip to content

Commit 4c01e2a

Browse files
committed
Clear deleted files from hiedb
1 parent 2d60333 commit 4c01e2a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ghcide/session-loader/Development/IDE/Session.hs

+2
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ runWithDb fp k = do
135135
`catch` \IncompatibleSchemaVersion{} -> removeFile fp
136136
withHieDb fp $ \writedb -> do
137137
initConn writedb
138+
-- Clear the index of any files that might have been deleted since the last run
139+
deleteMissingRealFiles writedb
138140
_ <- garbageCollectTypeNames writedb
139141
chan <- newTQueueIO
140142
withAsync (writerThread writedb chan) $ \_ -> do

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

+2
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,6 @@ setSomethingModified state = do
232232
VFSHandle{..} <- getIdeGlobalState state
233233
when (isJust setVirtualFileContents) $
234234
fail "setSomethingModified can't be called on this type of VFSHandle"
235+
-- Update database to remove any files that might have been renamed/deleted
236+
writeTQueue (indexQueue $ hiedbWriter $ shakeExtras state) deleteMissingRealFiles
235237
void $ shakeRestart state []

0 commit comments

Comments
 (0)