Skip to content

Commit

Permalink
fix(51100): ensure tsserver shuts down when parent process is killed (#…
Browse files Browse the repository at this point in the history
…51107)

* fix(51100): ensure tsserver shuts down when parent process is killed

When using IPC channel (`--useNodeIpc`) for communicating with tsserver,
the child tsserver process did not shut down on parent process disconnecting
(for example due to it being killed).

Call exit() on IPC disconnect, same as stdio-based communication did
when pipe to parent process was destroyed.

* don't duplicate inherited method
  • Loading branch information
rchl committed Oct 10, 2022
1 parent c01ae01 commit 9c87ded
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tsserver/nodeServer.ts
Expand Up @@ -783,6 +783,10 @@ namespace ts.server {
process.on("message", (e: any) => {
this.onMessage(e);
});

process.on("disconnect", () => {
this.exit();
});
}
}

Expand Down

0 comments on commit 9c87ded

Please sign in to comment.