sublimelsp / LSP-rust-analyzer

Convenience package for rust-analyzer
MIT License
70 stars 11 forks source link

Autocomplete not working for std types #70

Closed DeclanKehoe closed 1 year ago

DeclanKehoe commented 2 years ago

I am completely new to Rust and was following the tutorials (so ignore the actual functionality of the code please!) when I noticed that the autocomplete was not working for the types in std. For example, when trying to use the .len() method on an &str type object.

Sublime 1 Sublime 2

I installed rust-analyzer in two other editors; VSCode and Nova, and the len() method was suggested in both of those without issue, so I don't think the issue is rust-analyzer itself, just something in this implementation.

Nova VSCode

Maybe this is something to do with Sublime's autocomplete engine? I'm honestly not familiar enough to provide many other suggestions as to what's wrong, just that I noticed it happening with other std types as well (like abs for i32 not being suggested in Sublime, but no problems in Nova & VSCode).

istudyatuni commented 2 years ago

Also len is unknown

screenshot ![image](https://user-images.githubusercontent.com/43654815/174436570-8fb05555-1441-4d91-b757-dcc84a3b89d3.png)

Edit: now it works https://github.com/sublimelsp/LSP-rust-analyzer/issues/70#issuecomment-1188267603

Fan166-t commented 2 years ago

I found the version of rust-analyzer download is always 2022-1-10 as this plugin set the verison in plugin.py as a certain number, I guess maybe this 2022-1-10 version cause this bug. So I change the version of rust-analyzer.exe in VScode into 2022-1-10 andthis bug appear in VScode too. Then I download the lastest version of rust-analyzer manually and replace the version of auto-download in sublime, the bug you mentioned disappear, but the inly type hints also disappear, it troubled me.

istudyatuni commented 2 years ago

About the version, see description

https://github.com/sublimelsp/LSP-rust-analyzer/releases/tag/v1.0.4

DeclanKehoe commented 2 years ago

So based on the previous two comments; it's either a bit broken, or there's no in-line hints?

urschrei commented 2 years ago

there's no in-line hints

There are definitely in-line hints. This is with last Monday's Rust-Analyzer release on macOS x86_64:

Screenshot 2022-07-18 at 19 43 01
istudyatuni commented 2 years ago

Checked, now len hover info worked

rchl commented 1 year ago

This is probably resolved since the rust-analyzer version was updated.