Skip to content

Fix watcher not restarting code-server on VS Code compilation #4520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix watcher not restarting code-server on VS Code compilation
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.
  • Loading branch information
code-asher committed Nov 16, 2021
commit 30ce10a776ded849eea6f311cd438f7667640a1e
13 changes: 2 additions & 11 deletions ci/dev/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
})

Expand Down