mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-04 05:39:27 -05:00
fix(51100): ensure tsserver shuts down when parent process is killed (#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
This commit is contained in:
@@ -783,6 +783,10 @@ namespace ts.server {
|
||||
process.on("message", (e: any) => {
|
||||
this.onMessage(e);
|
||||
});
|
||||
|
||||
process.on("disconnect", () => {
|
||||
this.exit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user