@@ -258,9 +258,6 @@ public final actor SemanticIndexManager {
258
258
if let dependentTargets = await buildSystemManager. targets ( dependingOn: targets) {
259
259
await preparationUpToDateStatus. markOutOfDate ( dependentTargets)
260
260
} else {
261
- // We couldn't determine which targets depend on the modified targets. Be conservative and assume all of them do.
262
- await indexStoreUpToDateStatus. markOutOfDate ( changedFiles)
263
-
264
261
await preparationUpToDateStatus. markAllOutOfDate ( )
265
262
// `markAllOutOfDate` only marks targets out-of-date that have been indexed before. Also mark all targets with
266
263
// in-progress preparation out of date. So we don't get into the following situation, which would result in an
@@ -519,10 +516,11 @@ public final actor SemanticIndexManager {
519
516
520
517
let filesToIndex = targetsBatch. flatMap ( { filesByTarget [ $0] ! } )
521
518
for file in filesToIndex {
522
- // indexStatus will get set to `.upToDate` by `updateIndexStore`. Setting it to `.upToDate` cannot race with
523
- // setting it to `.scheduled` because we don't have an `await` call between the creation of `indexTask` and
519
+ // The state of `inProgressIndexTasks` will get pushed on from `updateIndexStore`.
520
+ // The updates to `inProgressIndexTasks` from `updateIndexStore` cannot race with setting it to
521
+ // `.waitingForPreparation` here because we don't have an `await` call between the creation of `indexTask` and
524
522
// this loop, so we still have exclusive access to the `SemanticIndexManager` actor and hence `updateIndexStore`
525
- // can't execute until we have set all index statuses to `.scheduled `.
523
+ // can't execute until we have set all index statuses to `.waitingForPreparation `.
526
524
inProgressIndexTasks [ file. sourceFile] = . waitingForPreparation(
527
525
preparationTaskID: preparationTaskID,
528
526
indexTask: indexTask
0 commit comments