From ed50c3678999e6b0e42bd14367b79e4348db29cf Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Wed, 30 Apr 2025 12:20:51 -0500 Subject: fix: lsp issues with tmp and deleted files --- internal/app/lsp.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/app') 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) -- cgit v1.2.3