fix(daemon): auto-shutdown when last LSP server entry is evicted
This commit is contained in:
@@ -107,6 +107,11 @@ function evict(entry: ClientEntry, reason: string) {
|
|||||||
entries.delete(entry.key);
|
entries.delete(entry.key);
|
||||||
if (entry.idleTimer) clearTimeout(entry.idleTimer);
|
if (entry.idleTimer) clearTimeout(entry.idleTimer);
|
||||||
void entry.client.dispose();
|
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
|
// Sync File - Ensures the language server has the current contents of the
|
||||||
|
|||||||
Reference in New Issue
Block a user