File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -225,9 +225,6 @@ package final actor SemanticIndexManager {
225225 if inProgressPreparationTasks. values. contains ( where: { $0. purpose == . forEditorFunctionality } ) {
226226 return . preparingFileForEditorFunctionality
227227 }
228- if !scheduleIndexingTasks. isEmpty {
229- return . schedulingIndexing
230- }
231228 let preparationTasks = inProgressPreparationTasks. mapValues { inProgressTask in
232229 return inProgressTask. task. isExecuting ? IndexTaskStatus . executing : IndexTaskStatus . scheduled
233230 }
@@ -239,10 +236,16 @@ package final actor SemanticIndexManager {
239236 return updateIndexStoreTask. isExecuting ? IndexTaskStatus . executing : IndexTaskStatus . scheduled
240237 }
241238 }
242- if preparationTasks. isEmpty && indexTasks. isEmpty {
243- return . upToDate
239+ if !preparationTasks. isEmpty || !indexTasks. isEmpty {
240+ return . indexing( preparationTasks: preparationTasks, indexTasks: indexTasks)
241+ }
242+ // Only report the `schedulingIndexing` status when we don't have any in-progress indexing tasks. This way we avoid
243+ // flickering between indexing progress and `Scheduling indexing` if we trigger an index schedule task while
244+ // indexing is already in progress
245+ if !scheduleIndexingTasks. isEmpty {
246+ return . schedulingIndexing
244247 }
245- return . indexing ( preparationTasks : preparationTasks , indexTasks : indexTasks )
248+ return . upToDate
246249 }
247250
248251 package init (
You can’t perform that action at this time.
0 commit comments