Skip to content

Show “Preparing targets” as index status if we only have preparation tasks and no index tasks #1400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Sources/SourceKitLSP/IndexProgressManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ actor IndexProgressManager {
// `indexTasksWereScheduled` calls yet but the semantic index managers already track them in their in-progress tasks.
// Clip the finished tasks to 0 because showing a negative number there looks stupid.
let finishedTasks = max(queuedIndexTasks - indexTasks.count, 0)
message = "\(finishedTasks) / \(queuedIndexTasks)"
if indexTasks.isEmpty {
message = "Preparing targets"
} else {
message = "\(finishedTasks) / \(queuedIndexTasks)"
}
if await sourceKitLSPServer.options.experimentalFeatures.contains(.showActivePreparationTasksInProgress) {
var inProgressTasks: [String] = []
inProgressTasks += preparationTasks.filter { $0.value == .executing }
Expand Down