Skip to content
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

Rust Analyzer completion issues #1452

Closed
TatriX opened this issue Feb 24, 2020 · 5 comments
Closed

Rust Analyzer completion issues #1452

TatriX opened this issue Feb 24, 2020 · 5 comments

Comments

@TatriX
Copy link

TatriX commented Feb 24, 2020

rust-analyzer completion is practically unusable.

See also #1269

Describe the bug
2020-02-24-122346_840x646_scrot
Weird completion with rust-analyzer.

To Reproduce

emacs -q -l lsp-start-plain.el

then open src/main.rs, find x. and M-tab.
See attached zip for a test case.
rust-analyzer-tests.zip

Expected behavior
With (setq rustic-lsp-server 'rls)
2020-02-24-122657_1446x608_scrot

Which Language Server did you use
rls & rust-analyzer

OS
Arch Linux.
I'm using Emacs from master, and also tried 26.3 just in case.

@kiennq
Copy link
Member

kiennq commented Feb 24, 2020

If you put the use std::collections::HashMap; outside of function, you can see the proper completions.

@TatriX
Copy link
Author

TatriX commented Feb 24, 2020

Well, if you use for example diesel, then you are expected to put use statements in your functions. And I do this quite often if I want to test something. It's a legitimate language feature and I expect completion to work in this case.

@flodiebold
Copy link
Contributor

flodiebold commented Feb 24, 2020

We of course plan to support this, but it is very complicated to implement. You can follow rust-lang/rust-analyzer#1165 for it. TBH, 'practically unusable' and 'I expect' is not the kind of tone that will motivate people to work on this for you though.

@yyoncho
Copy link
Member

yyoncho commented Feb 24, 2020

@TatriX I am closing the PR based on the fact that this is something that has to be fixed on the server and there is nothing address on lsp-mode's side.

@yyoncho yyoncho closed this as completed Feb 24, 2020
@TatriX
Copy link
Author

TatriX commented Feb 24, 2020

TBH, 'practically unusable' and 'I expect' is not the kind of tone that will motivate people to work on this for you though.

Sorry if that sounded rude, I didn't mean that. It's practically unusable for me right now, not in general. I understood suggestion to move use statement out of the function as "not a bug", so I just wanted to say that it should work in principle as it's what I expect after rls, not that I'm expecting someone to go and fix it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants