summaryrefslogtreecommitdiffhomepage
path: root/internal/app
diff options
context:
space:
mode:
Diffstat (limited to 'internal/app')
-rw-r--r--internal/app/lsp.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/app/lsp.go b/internal/app/lsp.go
index 872532fd8..934bd1a89 100644
--- a/internal/app/lsp.go
+++ b/internal/app/lsp.go
@@ -118,8 +118,14 @@ func (app *App) restartLSPClient(ctx context.Context, name string) {
shutdownCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
_ = oldClient.Shutdown(shutdownCtx)
cancel()
+
+ // Ensure we close the client to free resources
+ _ = oldClient.Close()
}
+ // Wait a moment before restarting to avoid rapid restart cycles
+ time.Sleep(1 * time.Second)
+
// Create a new client using the shared function
app.createAndStartLSPClient(ctx, name, clientConfig.Command, clientConfig.Args...)
logging.Info("Successfully restarted LSP client", "client", name)