-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a timeout for LSP auto-format #1639
Comments
As a workaround, you can disable auto-format for rust in your You might want to run helix with the |
Should we also have a timeout for formatting ? |
Definitely. But further, should the file just be written anyway? Then try auto-format and overwrite if if was successful within the timeout period? also see #2059 (comment) |
@antoyo This definitely looks like there's an issue with your LSP. However, this does suggest that in general, it would be good to add the ability to add timeouts to the async jobs. I don't know if there are any type landmines here, but it could be simple to just add a Should we just rename this issue to track that work? I'd be happy to pick that up after my open PR is closed, I expect it would be a quick change. |
Is there someone working on this issue at the moment ? If not I can try to fix it as the solution suggested by @dead10ck seems reasonable and relatively easy to implement. |
I think we do actually have a timeout mechanism: Lines 443 to 448 in 17dd102
We also write regardless of whether formatting was successful: helix/helix-term/src/commands.rs Lines 3098 to 3136 in 17dd102
|
yeah the timeout is just pretty long by default (20s) and apply equally to all LSP operations. We could look at how VSCode handles that (default timeout, different timeouts for different operations, what is the default for those operations that have dedicated timeouts) |
Reproduction steps
I'm not sure exactly what it takes for this to happen, but I used the
write
command on a Rust file and the changes were not reflected automatically on disk. It could take +10 seconds.From the logs, it looks like it might have been waiting for the LSP to do the formatting, but failed.
Environment
~/.cache/helix/helix.log
The text was updated successfully, but these errors were encountered: