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.
This commit is contained in:
parent
ccb9d948c0
commit
cd26f84bc6
|
@ -106,19 +106,10 @@ class Watcher {
|
||||||
plugin.stderr.on("data", (d) => process.stderr.write(d))
|
plugin.stderr.on("data", (d) => process.stderr.write(d))
|
||||||
}
|
}
|
||||||
|
|
||||||
let startingVscode = false
|
|
||||||
let startedVscode = false
|
|
||||||
onLine(vscode, (line, original) => {
|
onLine(vscode, (line, original) => {
|
||||||
console.log("[vscode]", original)
|
console.log("[vscode]", original)
|
||||||
// Wait for watch-client since "Finished compilation" will appear multiple
|
if (line.includes("Finished compilation")) {
|
||||||
// times before the client starts building.
|
restartServer()
|
||||||
if (!startingVscode && line.includes("Starting watch-client")) {
|
|
||||||
startingVscode = true
|
|
||||||
} else if (startingVscode && line.includes("Finished compilation")) {
|
|
||||||
if (startedVscode) {
|
|
||||||
restartServer()
|
|
||||||
}
|
|
||||||
startedVscode = true
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue