Skip to content

Commit 7fbb39e

Browse files
authored
Merge pull request #1344 from ahoppen/update-indexstore-db-before-deciding-what-to-index
Ensure that the indexstore-db is up-to-date before deciding which source files we need to re-index
2 parents 7cf9f15 + 4ad6eb3 commit 7fbb39e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/SemanticIndex/SemanticIndexManager.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ public final actor SemanticIndexManager {
193193
signposter.endInterval("Preparing", state)
194194
}
195195
await orLog("Generating build graph") { try await self.buildSystemManager.generateBuildGraph() }
196+
// Ensure that we have an up-to-date indexstore-db. Waiting for the indexstore-db to be updated is cheaper than
197+
// potentially not knowing about unit files, which causes the corresponding source files to be re-indexed.
198+
index.pollForUnitChangesAndWait()
196199
let index = index.checked(for: .modifiedFiles)
197200
let filesToIndex = await self.buildSystemManager.sourceFiles().lazy.map(\.uri)
198201
.filter { uri in

0 commit comments

Comments
 (0)