Shutdown language servers better (#35038)

Follow-up of https://github.com/zed-industries/zed/pull/33417

* adjust prettier mock LSP to handle `shutdown` and `exit` messages
* removed another `?.log_err()` backtrace from logs and improved the
logging info
* always handle the last parts of the shutdown logic even if the
shutdown response had failed

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-07-24 18:24:53 +03:00 committed by GitHub
parent 2a9355a3d2
commit 2658b2801e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 27 deletions

View file

@ -152,6 +152,10 @@ async function handleMessage(message, prettier) {
throw new Error(`Message method is undefined: ${JSON.stringify(message)}`);
} else if (method == "initialized") {
return;
} else if (method === "shutdown") {
sendResponse({ result: {} });
} else if (method == "exit") {
process.exit(0);
}
if (id === undefined) {