fix: lsp issues with tmp and deleted files

This commit is contained in:
adamdottv 2025-04-30 12:20:51 -05:00
commit ed50c36789
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
3 changed files with 96 additions and 19 deletions

View file

@ -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)