From cd26f84bc6e0e6f5c17d847d9fdd718980b657a8 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 16 Nov 2021 16:21:14 -0600 Subject: [PATCH] Fix watcher not restarting code-server on VS Code compilation (#4520) The "Starting watch-client" string no longer appears in the latest build output. We could look for "Finished compilation with" to avoid restarting when other tasks restart (since they also include the name i.e. "Finished compilation extensions with 0 errors") but I figure we might as well restart code-server when any compilation task completes in case other tasks include changes that need to be reloaded. --- ci/dev/watch.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ci/dev/watch.ts b/ci/dev/watch.ts index 6b783f406..3aeca8e08 100644 --- a/ci/dev/watch.ts +++ b/ci/dev/watch.ts @@ -106,19 +106,10 @@ class Watcher { plugin.stderr.on("data", (d) => process.stderr.write(d)) } - let startingVscode = false - let startedVscode = false onLine(vscode, (line, original) => { console.log("[vscode]", original) - // Wait for watch-client since "Finished compilation" will appear multiple - // times before the client starts building. - if (!startingVscode && line.includes("Starting watch-client")) { - startingVscode = true - } else if (startingVscode && line.includes("Finished compilation")) { - if (startedVscode) { - restartServer() - } - startedVscode = true + if (line.includes("Finished compilation")) { + restartServer() } })