Skip to content

Show build preparing status immediately #1327

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 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
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
19 changes: 8 additions & 11 deletions src/ui/SwiftBuildStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,17 @@ export class SwiftBuildStatus implements vscode.Disposable {
return false;
}
}
// If we've found nothing that matches a known state then put up a temporary
// message that we're preparing the build, as there is sometimes a delay before
// building starts while the build system is preparing, especially in large projects.
// The status bar has a message immediately, so only show this when using a
// notification to show progress.
if (
!started &&
(showBuildStatus === "notification" || showBuildStatus === "progress")
) {
update(`${name}: Preparing...`);
}
return false;
};

// Begin by showing a message that the build is preparing, as there is sometimes
// a delay before building starts, especially in large projects.
// The status bar has a message immediately, so only show this when using a
// notification to show progress.
if (!started && (showBuildStatus === "notification" || showBuildStatus === "progress")) {
update(`${name}: Preparing...`);
}

return execution.onDidWrite(data => {
if (parseEvents(data)) {
done();
Expand Down
5 changes: 2 additions & 3 deletions test/unit-tests/ui/SwiftBuildStatus.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ suite("SwiftBuildStatus Unit Test Suite", async function () {
"Build complete!"
);

// Report nothing
expect(mockedProgress.report).to.not.have.been.called;
expect(mockedStatusItem.update).to.not.have.been.called;
// Report only the preparing message
expect(mockedProgress.report).to.have.been.calledWith({ message: "My Task: Preparing..." });
});
});
Loading