fix(daemon): auto-shutdown when last LSP server entry is evicted

This commit is contained in:
2026-04-30 08:21:16 -04:00
parent 36b9b0cde4
commit 81ed5c88b8

View File

@@ -107,6 +107,11 @@ function evict(entry: ClientEntry, reason: string) {
entries.delete(entry.key);
if (entry.idleTimer) clearTimeout(entry.idleTimer);
void entry.client.dispose();
// Auto Shutdown - If this was the last entry, there's nothing left to
// manage. Tear down the daemon so it doesn't sit idle forever.
if (entries.size === 0) {
shutdownDaemon("all entries evicted");
}
}
// Sync File - Ensures the language server has the current contents of the