@@ -76,9 +76,9 @@ public final actor SemanticIndexManager {
76
76
/// ...). `nil` if no build graph is currently being generated.
77
77
private var generateBuildGraphTask : Task < Void , Never > ?
78
78
79
- private let preparationUpToDateStatus = IndexUpToDateStatusManager < ConfiguredTarget > ( )
79
+ private let preparationUpToDateTracker = UpToDateTracker < ConfiguredTarget > ( )
80
80
81
- private let indexStoreUpToDateStatus = IndexUpToDateStatusManager < DocumentURI > ( )
81
+ private let indexStoreUpToDateTracker = UpToDateTracker < DocumentURI > ( )
82
82
83
83
/// The preparation tasks that have been started and are either scheduled in the task scheduler or currently
84
84
/// executing.
@@ -258,23 +258,23 @@ public final actor SemanticIndexManager {
258
258
// We only re-index the files that were changed and don't re-index any of their dependencies. See the
259
259
// `Documentation/Files_To_Reindex.md` file.
260
260
let changedFiles = events. map ( \. uri)
261
- await indexStoreUpToDateStatus . markOutOfDate ( changedFiles)
261
+ await indexStoreUpToDateTracker . markOutOfDate ( changedFiles)
262
262
263
263
// Note that configured targets are the right abstraction layer here (instead of a non-configured target) because a
264
264
// build system might have targets that include different source files. Hence a source file might be in target T
265
265
// configured for macOS but not in target T configured for iOS.
266
266
let targets = await changedFiles. asyncMap { await buildSystemManager. configuredTargets ( for: $0) } . flatMap { $0 }
267
267
if let dependentTargets = await buildSystemManager. targets ( dependingOn: targets) {
268
- await preparationUpToDateStatus . markOutOfDate ( dependentTargets)
268
+ await preparationUpToDateTracker . markOutOfDate ( dependentTargets)
269
269
} else {
270
- await preparationUpToDateStatus . markAllOutOfDate ( )
270
+ await preparationUpToDateTracker . markAllKnownOutOfDate ( )
271
271
// `markAllOutOfDate` only marks targets out-of-date that have been indexed before. Also mark all targets with
272
272
// in-progress preparation out of date. So we don't get into the following situation, which would result in an
273
273
// incorrect up-to-date status of a target
274
274
// - Target preparation starts for the first time
275
275
// - Files changed
276
276
// - Target preparation finishes.
277
- await preparationUpToDateStatus . markOutOfDate ( inProgressPreparationTasks. keys)
277
+ await preparationUpToDateTracker . markOutOfDate ( inProgressPreparationTasks. keys)
278
278
}
279
279
280
280
await scheduleBackgroundIndex ( files: changedFiles)
@@ -352,7 +352,7 @@ public final actor SemanticIndexManager {
352
352
// schedule two preparations of the same target in quick succession, only the first one actually performs a prepare
353
353
// and the second one will be a no-op once it runs.
354
354
let targetsToPrepare = await targets. asyncFilter {
355
- await !preparationUpToDateStatus . isUpToDate ( $0)
355
+ await !preparationUpToDateTracker . isUpToDate ( $0)
356
356
}
357
357
358
358
guard !targetsToPrepare. isEmpty else {
@@ -363,7 +363,7 @@ public final actor SemanticIndexManager {
363
363
PreparationTaskDescription (
364
364
targetsToPrepare: targetsToPrepare,
365
365
buildSystemManager: self . buildSystemManager,
366
- preparationUpToDateStatus : preparationUpToDateStatus ,
366
+ preparationUpToDateTracker : preparationUpToDateTracker ,
367
367
indexProcessDidProduceResult: indexProcessDidProduceResult,
368
368
testHooks: testHooks
369
369
)
@@ -410,7 +410,7 @@ public final actor SemanticIndexManager {
410
410
filesToIndex: filesAndTargets,
411
411
buildSystemManager: self . buildSystemManager,
412
412
index: index,
413
- indexStoreUpToDateStatus : indexStoreUpToDateStatus ,
413
+ indexStoreUpToDateTracker : indexStoreUpToDateTracker ,
414
414
indexProcessDidProduceResult: indexProcessDidProduceResult,
415
415
testHooks: testHooks
416
416
)
@@ -455,7 +455,7 @@ public final actor SemanticIndexManager {
455
455
// schedule two indexing jobs for the same file in quick succession, only the first one actually updates the index
456
456
// store and the second one will be a no-op once it runs.
457
457
let outOfDateFiles = await filesToIndex ( toCover: files) . asyncFilter {
458
- return await !indexStoreUpToDateStatus . isUpToDate ( $0. sourceFile)
458
+ return await !indexStoreUpToDateTracker . isUpToDate ( $0. sourceFile)
459
459
}
460
460
// sort files to get deterministic indexing order
461
461
. sorted ( by: { $0. sourceFile. stringValue < $1. sourceFile. stringValue } )
0 commit comments