fix: lsp issues with tmp and deleted files
This commit is contained in:
parent
98cf65b425
commit
ed50c36789
3 changed files with 96 additions and 19 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue