Emacs/rustic/rust-analyzer/company completion issue

Hi, I need help with code completion.
When I select completion I get additional stuff inserted into buffer, when selecting cmp() for example I get "(as Ord)" inserted, or "(use std::fmt::Debug)" when I select fmt().
I assume that those should trigger auto import but somehow it doesn't work.
I looked through the lsp-mode and rust-analyzer documentation ... there is "rust-analyzer.completion.autoimport.enable" which is true by deafult, not sure how to set it to false so I don't get additional stuff (since I don't know how to enable it doing anything useful)
Thanks

That seems like an lsp-mode issue. Rust-analyzer passes both the actual completion and a label to present to the user. It seems like lsp-mode incorrectly inserts the label instead of the actual completion.

Looks like, I've updated to last lsp-mode and now I'm getting error message:
company-call-backend-raw: Company: Back-end company-capf error "Marker does not point anywhere" with args (post-completion partial_cmp(…) (as PartialOrd))

How can I configure "rust-analyer" not to send additional stuff ("rust-analyzer.completion.autoimport.enable" to false) ?
Milan

I don't know how to set lsp server configurations with lsp-mode.

This should just work and I've never seen it fail that way. I would suggest reporting it in the lsp-mode repo.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.