rust-lang / rls

Repository for the Rust Language Server (aka RLS)
Other
3.51k stars 257 forks source link

completion not working with modules #1383

Open jamesmahler opened 5 years ago

jamesmahler commented 5 years ago

I've finally figured out the pattern to make my auto completion break. It worked great until my project go too large, but my lines of code are way smaller than others that are working.

It comes down to modules and how I do them. I've managed to make a very minimal project that shows this. Attached is a tar.gz of setup that can replicate it. I haven't tried pre-2018 syntax for doing them. I'm wondering if the missing mod.rs is breaking it. You don't need the workspace to break it, you can just open my_bin, I just like cargo workspaces for vs code.

Look at my_bin/src/main.rs . It has comments of what works and what doesn't. All references are to things in my_lib/src. However I believe this is also breaking creates and std references that won't complete for me.

I'm using stable, not sure how to get version. Updated today. Using vscode as frontend, but saw similar in eclipse corrosion.

wontComplete.tar.gz

fwcd commented 4 years ago

Same issue, modules using the 2015-syntax with a mod.rs file show up in completions, those using the new 2018-syntax do not.

dennybritz commented 4 years ago

Bump this. Autocomplete does not work without a mod.rs file.

jamesmahler commented 4 years ago

Honestly I gave up on RLS around 1 year.

Look at using rust-analyzer. It does not have this issue, and just seems better. That is what I have been using.

dennybritz commented 4 years ago

Thanks a lot for letting me know about rust-analyzer. I just tried it and it looks like a great alternative, no issues so far.

krooq commented 4 years ago

ooft still not working :( Makes learning to use new libraries really hard, navigating the repo in the browser while coding IDE. Switching to rust-analyzer as well.

I hope this gets fixed, IDE support was number 2 in the top 10 in 2018! https://blog.rust-lang.org/2018/11/27/Rust-survey-2018.html#challenges