Skip to content
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

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

Merged
merged 2 commits into from Oct 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/tsserver/nodeServer.ts
Expand Up @@ -779,10 +779,21 @@ namespace ts.server {
return JSON.stringify(message, undefined, 2);
}

public exit() {
this.logger.info("Exiting...");
this.projectService.closeLog();
tracing?.stopTracing();
process.exit(0);
}
rchl marked this conversation as resolved.
Show resolved Hide resolved

public listen() {
process.on("message", (e: any) => {
this.onMessage(e);
});

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

Expand Down