From a309c1aa2bf249c1ff4148e91b524ef60ff99f6b Mon Sep 17 00:00:00 2001 From: Michael Karcher Date: Fri, 12 Dec 2025 11:18:40 +0100 Subject: [PATCH] fix(@schematics/angular): improve VS Code background compilation start/end detection The task is initially "active", and should be considered "completed" when the bundle generation result is displayed, even if the generation failed. The task should only switch back to "active" when changes are detected, not on any arbitrary output by `ng watch`. This change enables proper handling of re-attaching the debugger while the background task is already running. Fixes #32111 --- .../workspace/files/__dot__vscode/tasks.json.template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/schematics/angular/workspace/files/__dot__vscode/tasks.json.template b/packages/schematics/angular/workspace/files/__dot__vscode/tasks.json.template index f3125a95b776..96e9e1c26833 100644 --- a/packages/schematics/angular/workspace/files/__dot__vscode/tasks.json.template +++ b/packages/schematics/angular/workspace/files/__dot__vscode/tasks.json.template @@ -12,10 +12,10 @@ "background": { "activeOnStart": true, "beginsPattern": { - "regexp": "(.*?)" + "regexp": "Changes detected" }, "endsPattern": { - "regexp": "bundle generation complete" + "regexp": "bundle generation (complete|failed)" } } } @@ -30,10 +30,10 @@ "background": { "activeOnStart": true, "beginsPattern": { - "regexp": "(.*?)" + "regexp": "Changes detected" }, "endsPattern": { - "regexp": "bundle generation complete" + "regexp": "bundle generation (complete|failed)" } } }