Skip to content

Commit

Permalink
Fix hanging build status in vscode 1.92 (#998)
Browse files Browse the repository at this point in the history
Is hanging build status when debugging a test. The build task ends
but the status keeps churning, never hiding itself. For some
reason the execution's emitter never fires. For now putting this
fix in to prevent the hang.
  • Loading branch information
award999 authored Aug 7, 2024
1 parent 9548412 commit beec5e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/TestExplorer/TestRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ export class TestRunner {
const subscriptions: vscode.Disposable[] = [];
let buildExitCode = 0;
const buildTask = vscode.tasks.onDidStartTask(e => {
if (e.execution.task.name === "Build All") {
if (e.execution.task.name === buildAllTask.name) {
const exec = e.execution.task.execution as SwiftExecution;
const didCloseBuildTask = exec.onDidClose(exitCode => {
buildExitCode = exitCode ?? 0;
Expand Down
7 changes: 6 additions & 1 deletion src/ui/SwiftBuildStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ export class SwiftBuildStatus implements vscode.Disposable {
done();
}
}),
execution.onDidClose(done)
execution.onDidClose(done),
vscode.tasks.onDidEndTask(e => {
if (e.execution.task === task) {
done();
}
})
);
});
if (showBuildStatus === "progress" || showBuildStatus === "notification") {
Expand Down

0 comments on commit beec5e6

Please sign in to comment.