Create a new rust project and change src/main.rs to the following code:
fn main() {
vec![].iter();
}
Save and exit.
Restart the editor and wait for the language server to finish initialization.
Go into insert mode in line 2 between ] and ..
Enter .r<cr> (<cr> means enter, not the literal characters. Wait until suggestions appear before pressing enter.)
Suggestion is inserted but overwrites part of the line. Result (assuming the first suggestion was the remove function):
fn main() {
vec![].remove(index)();
}
This is different from the expected result which would be:
fn main() {
vec![].remove(index).iter();
}
This only seems to happen when suggest.noselect is true, no option is selected (e.g. via <tab>), and at least one character is entered after the .. The more characters are entered before accepting the suggestion with <cr>, the fewer characters get deleted. I'm not sure if this issue is specific to coc-rust-analyzer or if it affects other extensions as well, but I've not observed it with other extensions.
What's the output of :CocInfo
## versions
vim version: NVIM v0.10.2
node version: v22.9.0
coc.nvim version: 0.0.82-9fd85781 2024-09-21 00:59:00 +0900
coc.nvim directory: /home/drainer/.local/share/nvim/lazy/coc.nvim
term: xterm-kitty
platform: linux
## Log of coc.nvim
2024-10-15T02:28:28.838 INFO (pid:94176) [plugin] - coc.nvim initialized with node: v22.9.0 after 165
2024-10-15T02:28:28.839 INFO (pid:94176) [services] - LanguageClient Rust Analyzer Language Server state change: stopped => starting
2024-10-15T02:28:28.848 INFO (pid:94176) [language-client-index] - Language server "rust-analyzer" started with 94188
2024-10-15T02:28:28.862 INFO (pid:94176) [services] - LanguageClient Rust Analyzer Language Server state change: starting => running
2024-10-15T02:28:28.890 INFO (pid:94176) [services] - service rust-analyzer started
2024-10-15T02:28:28.958 ERROR (pid:94176) [extension:coc-rust-analyzer] - {"message":"API rate limit exceeded for 83.175.72.117. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
What's the output of :CocCommand rust-analyzer.serverVersion
rust-analyzer 0.3.2146-standalone
What's your coc-rust-analyzer version? You can get it from :CocList extensions
Using the following configuration:
init.lua
:coc-settings.json
:I can reproduce the issue in the following way:
src/main.rs
to the following code:]
and.
..r<cr>
(<cr>
means enter, not the literal characters. Wait until suggestions appear before pressing enter.)remove
function):This is different from the expected result which would be:
This only seems to happen when
suggest.noselect
is true, no option is selected (e.g. via<tab>
), and at least one character is entered after the.
. The more characters are entered before accepting the suggestion with<cr>
, the fewer characters get deleted. I'm not sure if this issue is specific tococ-rust-analyzer
or if it affects other extensions as well, but I've not observed it with other extensions.What's the output of
:CocInfo
What's the output of
:CocCommand rust-analyzer.serverVersion
rust-analyzer 0.3.2146-standalone
What's your coc-rust-analyzer version? You can get it from
:CocList extensions
0.77.5