@@ -258,9 +258,6 @@ public final actor SemanticIndexManager {
258258 if let dependentTargets = await buildSystemManager. targets ( dependingOn: targets) {
259259 await preparationUpToDateStatus. markOutOfDate ( dependentTargets)
260260 } 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-
264261 await preparationUpToDateStatus. markAllOutOfDate ( )
265262 // `markAllOutOfDate` only marks targets out-of-date that have been indexed before. Also mark all targets with
266263 // 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 {
519516
520517 let filesToIndex = targetsBatch. flatMap ( { filesByTarget [ $0] ! } )
521518 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
524522 // 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 `.
526524 inProgressIndexTasks [ file. sourceFile] = . waitingForPreparation(
527525 preparationTaskID: preparationTaskID,
528526 indexTask: indexTask
0 commit comments