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 {
225
225
if inProgressPreparationTasks. values. contains ( where: { $0. purpose == . forEditorFunctionality } ) {
226
226
return . preparingFileForEditorFunctionality
227
227
}
228
- if !scheduleIndexingTasks. isEmpty {
229
- return . schedulingIndexing
230
- }
231
228
let preparationTasks = inProgressPreparationTasks. mapValues { inProgressTask in
232
229
return inProgressTask. task. isExecuting ? IndexTaskStatus . executing : IndexTaskStatus . scheduled
233
230
}
@@ -239,10 +236,16 @@ package final actor SemanticIndexManager {
239
236
return updateIndexStoreTask. isExecuting ? IndexTaskStatus . executing : IndexTaskStatus . scheduled
240
237
}
241
238
}
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
244
247
}
245
- return . indexing ( preparationTasks : preparationTasks , indexTasks : indexTasks )
248
+ return . upToDate
246
249
}
247
250
248
251
package init (
You can’t perform that action at this time.
0 commit comments