From d30169e04b2193b6bb747a1c1682faadb10b4884 Mon Sep 17 00:00:00 2001 From: Jibbo Date: Sat, 23 Aug 2025 22:32:31 -0400 Subject: [PATCH 1/2] Stops the old laguage client and clears out io events when creating a new client. --- src/lsp/ClientConnectionManager.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lsp/ClientConnectionManager.ts b/src/lsp/ClientConnectionManager.ts index 210019ee8..58b714b16 100644 --- a/src/lsp/ClientConnectionManager.ts +++ b/src/lsp/ClientConnectionManager.ts @@ -75,6 +75,8 @@ export class ClientConnectionManager { private create_new_client() { const port = this.client?.port ?? -1; + this.client?.io?.removeAllListeners(); + this.client?.stop(); this.client?.events?.removeAllListeners(); this.client = new GDScriptLanguageClient(); this.client.port = port; From de02af3bb1fae830e7e8d6dea9970b64223f0d01 Mon Sep 17 00:00:00 2001 From: Jibbo Date: Sat, 23 Aug 2025 22:50:57 -0400 Subject: [PATCH 2/2] Cleaning up diconnect order. --- src/lsp/ClientConnectionManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lsp/ClientConnectionManager.ts b/src/lsp/ClientConnectionManager.ts index 58b714b16..252311035 100644 --- a/src/lsp/ClientConnectionManager.ts +++ b/src/lsp/ClientConnectionManager.ts @@ -76,8 +76,8 @@ export class ClientConnectionManager { private create_new_client() { const port = this.client?.port ?? -1; this.client?.io?.removeAllListeners(); - this.client?.stop(); this.client?.events?.removeAllListeners(); + this.client?.stop(); this.client = new GDScriptLanguageClient(); this.client.port = port; this.client.events.on("status", this.on_client_status_changed.bind(this));