-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Async formatting #53
Comments
This is because we try to |
Would it be possible to format the code asynchronously? It's kind of unexpected that it's a synchronous operation blocking the UI. If not, I think it makes sense for you to be able to opt out. 👍 |
I think you would likely run into issues if formatting took a while to run async while you made further text edits. I'll add a config option to enable it only for certain languages. |
Yeah, I guess it depends. I've seen it done both ways. If done asynchronously, one could discard the formatting if the buffer changed in between saving the file and the action actually completing. |
I think it does make sense to discard the formatting in that case, but one annoying thing is that you want the formatting to be saved. I guess you'd need to:
I could try implementing that if it sounds reasonable. |
Same noticeable delay when I press |
Is there no interest in the async formatting version? I like auto-format on save, but I'd also like it not to block the editor... |
Sorry about that, I missed the comment! I think some of this overlaps with #177 (comment) I'd be interested in this, but the |
This is because rust-analyzer takes some time to index before it starts responding to queries. |
Whenever I save a file (
:write
) with LSP enabled (e.g., solargraph for Ruby or rust-analyzer for Rust) the editor halts for 1-2 seconds until finally finishing. This behaviour isn't present when LSP is disabled.The text was updated successfully, but these errors were encountered: