Open maddiemort opened 3 years ago
FWIW, I'm experiencing the same delay with coc-nvim
+coc-rust-analyzer
.
Hi, does this patch speed things up https://github.com/rust-lang/rust.vim/pull/448?
@stsewd Found your submitted patch and applied it to my vim-polyglot "rustfmt.vim" file and rustfmt autosave improved from 2.8 secs to 0.8 secs on a file with ~700 lines. Definitely a massive improvement. Thank you!
I haven't had the chance to fully test the performance impact of your patch yet @stsewd, but my first impression is that it triggers this issue: neovim/neovim#14645
I managed to reproduce the issue mentioned by @nerosnm by reverting 'nvim_buf_set_lines()' back to 'call_setline()'.
I think this issue is still present - running :RustFmt
here is terribly slow (~10 seconds), while running it separately from the CLI is instantaneous.
Looks like the "fix" PR mentioned above ended up being reverted, probably because it was causing #14645. Is there another workaround?
It looks like https://github.com/neovim/neovim/issues/14645 is fixed. I've been manually applying https://github.com/rust-lang/rust.vim/pull/448 for years, but if the underlying neovim bug is fixed maybe it's time to re-merge it? I'll admit, I never noticed the https://github.com/neovim/neovim/issues/14645 bug before nvim 0.10.0, so I'm not the one to say if the behaviour that caused it to be rolled back is truly gone.
master
) installed through vim-plugSteps to reproduce:
nvim
from the tip ofmaster
(must be an 0.5 version)rustup
rustup toolchain install nightly-2021-03-01
rustup component add rustfmt --toolchain nightly-2021-03-01
rust-analyzer
(I'm on rust-analyzer 2021-02-15, installed via Nix unstable)Put the following minimal config in
~/.config/nvim/init.vim
:~/.local/share/nvim/site/autoload
and~/.local/share/nvim/plugged
are empty or do not existnvim
once to allow the plugins to install, then close it:lua vim.lsp.buf.hover()
(documentation info should appear):w
Expected vs. actual behavior:
Please note a few things:
:RustFmt
manually:RustFmt
still hangs just as much)cargo +nightly-2021-03-01 fmt
only takes about a second, at most, to run from outsidenvim
fish
(which is my login shell) causing delays, and I do see additional delays if I removeset shell=/bin/bash
from that config, but please note that that line meansfish
shouldn't be involved here. Changing my login shell tobash
orzsh
does not fix the problem.I'm happy to do any debugging or profiling you'd like me to, but you'll have to let me know what to run in order to do that, because my knowledge of vim really isn't extensive enough for me to know how to do that myself. Thanks!
Paste debugging info from the Rust Vim plugin via one of the following commands:
:RustInfo
,:RustInfoToClipboard
, or:RustInfoToFile <filename>
.