Skip to content

Commit fa32cbc

Browse files
committed
Do not re-index deleted files
This wasn’t an issue when we were always waiting for an up-to-date build graph before indexing files but now we could still have an old build graph that contains the deleted files and thus start an indexing process for a file that doesn’t exist anymore on disk. And it’s cleaner anyway.
1 parent 909c0a9 commit fa32cbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SemanticIndex/SemanticIndexManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ package final actor SemanticIndexManager {
379379
package func filesDidChange(_ events: [FileEvent]) async {
380380
// We only re-index the files that were changed and don't re-index any of their dependencies. See the
381381
// `Documentation/Files_To_Reindex.md` file.
382-
let changedFiles = events.map(\.uri)
382+
let changedFiles = events.filter { $0.type != .deleted }.map(\.uri)
383383
await indexStoreUpToDateTracker.markOutOfDate(changedFiles)
384384

385385
// Preparation tracking should be per file. For now consider any non-known-language change as having to re-prepare

0 commit comments

Comments
 (0)