Skip to content

Commit 471841c

Browse files
committed
Only show the Scheduling Indexing progress if no indexing tasks are currently happening
- **Issue**: Since #1973, we are watching for all changes in SourceKit-LSP. This means that we get notified every time the index database is changed. Each of these modifications triggers a new task that waits for build system updates to determine if the modified file needs to be re-indexed. While this task finishes very quickly, it still causes `Scheduling indexing` to replace the `Indexing x / y` in the index status during initial indexing, which looks very noisy. - **Explanation**: To avoid this flickering, only show `Scheduling indexing` in the index status if we aren’t already indexing any files - **Scope**: Index progress status - **Original PR**: This is a significantly reduced version of #2051 - **Risk**: Low, this only changes the precedence of status messages in the indexing status - **Testing**: Manually verified that we don’t see `Scheduling indexing` appear during initial indexing of a package - **Reviewer**: @bnbarham
1 parent 017c710 commit 471841c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SemanticIndex/SemanticIndexManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ package final actor SemanticIndexManager {
215215
if inProgressPreparationTasks.values.contains(where: { $0.purpose == .forEditorFunctionality }) {
216216
return .preparingFileForEditorFunctionality
217217
}
218-
if !scheduleIndexingTasks.isEmpty {
219-
return .schedulingIndexing
220-
}
221218
let preparationTasks = inProgressPreparationTasks.mapValues { inProgressTask in
222219
return inProgressTask.task.isExecuting ? IndexTaskStatus.executing : IndexTaskStatus.scheduled
223220
}
@@ -230,6 +227,9 @@ package final actor SemanticIndexManager {
230227
}
231228
}
232229
if preparationTasks.isEmpty && indexTasks.isEmpty {
230+
if !scheduleIndexingTasks.isEmpty {
231+
return .schedulingIndexing
232+
}
233233
return .upToDate
234234
}
235235
return .indexing(preparationTasks: preparationTasks, indexTasks: indexTasks)

0 commit comments

Comments
 (0)