Skip to content

Commit cd26f84

Browse files
authored
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.
1 parent ccb9d94 commit cd26f84

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

ci/dev/watch.ts

+2-11
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,10 @@ class Watcher {
106106
plugin.stderr.on("data", (d) => process.stderr.write(d))
107107
}
108108

109-
let startingVscode = false
110-
let startedVscode = false
111109
onLine(vscode, (line, original) => {
112110
console.log("[vscode]", original)
113-
// Wait for watch-client since "Finished compilation" will appear multiple
114-
// times before the client starts building.
115-
if (!startingVscode && line.includes("Starting watch-client")) {
116-
startingVscode = true
117-
} else if (startingVscode && line.includes("Finished compilation")) {
118-
if (startedVscode) {
119-
restartServer()
120-
}
121-
startedVscode = true
111+
if (line.includes("Finished compilation")) {
112+
restartServer()
122113
}
123114
})
124115

0 commit comments

Comments
 (0)