Closed andys8 closed 5 years ago
Is your feature request related to a problem? Please describe. With "coc.preferences.formatOnSaveFiletypes": ["elm"] using elm-format I get most of the time the timeout error.
"coc.preferences.formatOnSaveFiletypes": ["elm"]
elm-format
[coc.nvim] languageserver will save operation timeout after 0.5s
https://github.com/neoclide/coc.nvim/blob/9944b53f45fe0ad1f0ce0f04423c04ad826a679b/src/model/willSaveHandler.ts#L30
Describe the solution you'd like
Describe alternatives you've considered Using an ale fixer to do formatting.
ale
Additional context
time elm-format src/Main.elm --yes Processing file src/Main.elm 0.47user 0.03system 0:00.43elapsed 116%CPU (0avgtext+0avgdata 53168maxresident)k 0inputs+48outputs (0major+9855minor)pagefaults 0swaps
Running elm-format in the terminal on the file takes 430ms. So chances are high that 500 ms will not be enough.
500 ms
This is the language server used in the example. https://github.com/elm-tooling/elm-language-server#cocnvim
It's by design, the format should not take more than 0.5s. You can use
autocmd BufWritePre *.elm call CocAction('format')
instead.
Configuring per type would be preferable.
Is your feature request related to a problem? Please describe. With
"coc.preferences.formatOnSaveFiletypes": ["elm"]
usingelm-format
I get most of the time the timeout error.https://github.com/neoclide/coc.nvim/blob/9944b53f45fe0ad1f0ce0f04423c04ad826a679b/src/model/willSaveHandler.ts#L30
Describe the solution you'd like
Describe alternatives you've considered Using an
ale
fixer to do formatting.Additional context
Running
elm-format
in the terminal on the file takes 430ms. So chances are high that500 ms
will not be enough.This is the language server used in the example. https://github.com/elm-tooling/elm-language-server#cocnvim