-
Notifications
You must be signed in to change notification settings - Fork 182
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
bug: With format_on_save, timeout_ms must be set really high to have prettier working #401
Comments
The default value of 500ms should be plenty of time for most formatters, and since formatting freezes the UI you probably don't want it to be larger than 500ms anyway. The quick fix for you that I would recommend is try using Both
When your formatter takes a long time to run, the recommended way to handle this is via async formatting (such as |
Crystal-clear @stevearc, thank you so much for your detailed answer. It works like a charm! |
I was struggling with this same issue, and what fixed this for me was using
|
Neovim version (nvim -v)
v0.10.0-dev
Operating system/version
WSL (Windows Subsystem Linux), Ubuntu 20.04.6 LTS
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
Describe the bug
I was expecting that the suggested conf of 500 ms had worked just fine, but I had a timeout.
The same result setting
timeout_ms = nil
, or removing it (so getting the default 1 sec, I guess.It seems that like just the
async
option is not set tofalse
as documented.What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
Expected Behavior
I was expecting to have the file formatted by prettier and next saved by nvim. Only save succeed, and Conform reports the errors above. The only way to make it work is set to a very hight value like
timeout_ms = 999999
The text was updated successfully, but these errors were encountered: