-
-
Notifications
You must be signed in to change notification settings - Fork 899
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 doesn't autocomplete #1269
Comments
Completion doesn't currently work in macros in rust-analyzer. This is much more complicated than you might be expecting: the syntax inside a macro can mean basically anything. Try writing |
Closing based on the @flodiebold comment. Please reopen if you disagree. |
I do get completion candidates outside of macros, but I don't get |
@brotzeit Which do you get? |
It turns out this 'simple' example is even more complicated: rust-lang/rust-analyzer#2670 As long as there are some completions as in @brotzeit 's picture, |
Weird that it doesn't even show only options that start with 'l'. |
I think this is an option I have turned on. If there are candidates with the starting letter they are at the top, if they contain the letter they are below and if the letter isn't contained in any candidate company displays all possible candidates even if they don't match. |
This is company-lsp bug it does not filter candidates client side after initial retrieval. |
Oh, ok =) |
It seems that |
Can you try with |
For anyone else coming across this issue using doom-emacs |
It works better with method/function completion by still the same for regular variables and module names. As far as I remember Anyways my main complaint it that completion suggestions either completely missing, or given in random order which makes them basically unusable. I still don't understand whether it's my local problem or |
We fixed that and now we are trying it to polish it and make it the default company-backend for lsp-mode.
Can you open an issue for the cases that dont work? |
@Dummyc0m that's not quite correct. |
@TatriX I think this is not related to emacs. @flodiebold right ? |
rust-analyzer is perfectly usable in Emacs, I use it every day (with company). It should also be faster than RLS for large projects, though not always for completion (but completion will almost always be much more complete than RLS). |
Module completion including built-in names is a bug that has been recently fixed. The modules you're expecting are in the list, though, right? |
Yep, they are. I'll get the latest version and try again. Thanks. |
Hi @flodiebold , I just come to the emacs world for a few days. I still cannot get any completion list on spacemacs... Can you share ur setting regarding the autocompletion? |
@w93163red first make sure that everything is working as expected by doing M-x lsp-describe-session. Then, to force completion popup you may try M-x company-complete. |
@yyoncho Thanks for the reply! This is what I got from lsp-describe-session. |
This sounds like a separate issue. Can you check if company-complete actually performs the call to the server(set lsp-print-io to t and then lsp-workspace-show-log)? Also, can you make sure the project root contains the cargo file? |
@yyoncho
|
@w93163red why did you strip the log? In the first version there were compilation errors - can you try fixing them before trying to complete? Also, can you provide this project? |
@yyoncho |
I wouldn't expect rust-analyzer to work in the rustlings exercises. They're not a part of the normal Cargo project, rather the actual cargo project contains special code to compile them, and RA cannot know about that. |
At this point, I don't think there is anything to address in this issue after @kiennq rewrite of company-capf integration. Please reopen if you disagree(or file another issue). |
@yyoncho I'm facing the same problem as @w93163red. I'm trying Rustlings repo and I had to switch back to RLS for the time being. Could rust-analyzer consider a feature request for enabling support for standalone *.rs files? For example, assuming a basic Cargo.toml file with no dependencies. This could be enabled only with an option for example. |
@deavid I guess it will but the feature request should go in rust analyzer repo(we are only a client). |
@yyoncho Which release contains the fix? I try 20200409.1449, but still have this problem. |
Which problem do you have now? |
@jiacai2050 It's because |
Describe the bug
LSP using Rust-Analyzer doesn't autocomplete code.
To Reproduce
Expected behavior
I would expect LSP to autocomplete the function len() for the
arr
variable.Which Language Server did you use
Rust-Analyzer
OS
Manjaro Linux x86_64 - 4.19.91-1-MANJARO
The text was updated successfully, but these errors were encountered: