summaryrefslogtreecommitdiffhomepage
path: root/internal/app
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-04-30 12:20:51 -0500
committeradamdottv <[email protected]>2025-04-30 12:20:51 -0500
commited50c3678999e6b0e42bd14367b79e4348db29cf (patch)
treedc43612ea24bf8ac03c6bf86379e3a18f27023d4 /internal/app
parent98cf65b425014712f711cd7637def12c91f3a54b (diff)
downloadopencode-ed50c3678999e6b0e42bd14367b79e4348db29cf.tar.gz
opencode-ed50c3678999e6b0e42bd14367b79e4348db29cf.zip
fix: lsp issues with tmp and deleted files
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)