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

Recommended approach with RLS #1710

Closed
max-sixty opened this issue Aug 21, 2019 · 11 comments
Closed

Recommended approach with RLS #1710

max-sixty opened this issue Aug 21, 2019 · 11 comments

Comments

@max-sixty
Copy link

I've looked for guidance elsewhere but haven't found anything, so thought it OK to venture an issue here.

What's the recommended approach in VSCode for working with RLS? Currently:

  • If I turn RLS off, then I miss a few errors, particularly errors caught with cargo check --all
  • If I turn RLS on, I get duplicate entries in autocomplete & go to definition. While it's very manageable, it does add some minor friction for what's otherwise seamless actions.

Thank you for such an awesome tool - the latency makes rust so much nicer to work with!

@DJMcNab
Copy link
Contributor

DJMcNab commented Aug 21, 2019

I think you should use the cargo watch integration

@matklad
Copy link
Member

matklad commented Aug 21, 2019

Yeah, you should turn the RLS off and enable cargo-watch. To enable cargo watch, either answer "Yes" to the notification on project loading, or set the "rust-analyzer.enableCargoWatchOnStartup": "enabled", setting.

Closing, but feel free to reopen if this doesn't work!

@matklad matklad closed this as completed Aug 21, 2019
@lnicola
Copy link
Member

lnicola commented Aug 21, 2019

Does the cargo-watch integration pass --all? There's a parameter for extra arguments, but it might explain this issue.

@max-sixty
Copy link
Author

Thanks for the fast reply. I did have cargo-watch enabled.

I'm appreciative of rust-analyzer and the latency is awesome. For a relative newbie, a complete list of suggestions are v helpful. Is rust-analyzer expected to find as many suggestions as RLS? Or is the speed a tradeoff for completeness?

And next time I find a case where rust-analyzer doesn't have suggestions, and RLS does - should I post an issue?

@matklad
Copy link
Member

matklad commented Aug 21, 2019 via email

@max-sixty
Copy link
Author

max-sixty commented Aug 21, 2019

I do actually get clippy lint warnings.
I had remembered a few instances i wasn't getting 'suggestions' (what VSCode calls autocomplete), and so had to context switch into docs in the browser. I can put an issue in if that comes up again. (I realize difficult to engage without an actual example)

@flodiebold
Copy link
Member

I would be surprised if there are many cases left where RLS (i.e. racer) gives better completions than RA. Feel free to open issues if you find such examples.

@max-sixty
Copy link
Author

Great, thanks @flodiebold

@davemilter
Copy link

@flodiebold

I would be surprised if there are many cases left where RLS (i.e. racer) gives better completions than
Feel free to open issues if you find such examples.

Something off the top of my head:

  1. racer works for preprocessed files (
    https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-code-generation),
    while rust-analyzer just reports every second: "Rust file outside current workspace is not supported
    yet", which is very annoying.

  2. racer supports autocompletition of macroses from std::,
    unimplemented! is the most used by me for new code, and I just type un and racer does the rest.

@max-sixty
Copy link
Author

This is another, I think? #1622

Would be great to have this from RLS and everything else from rust-analyzer, for example. But maybe that's best implemented as a setting in RLS to exclude everything else

@oblitum
Copy link
Contributor

oblitum commented Sep 6, 2019

I switched to cargo-watch+clippy but I strongly miss instant diagnostics from RLS. Is there anything being worked on in that area? On Neovim I was using rust-analyzer through coc.nvim with diagnostics disabled, and RLS through ALE for diagnostics. FWIW I didn't enable diagnostics on every input, just when leaving insert mode and normal mode edits, which is a good balance, and better than being forced to save the file to sync diagnostics.

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

7 participants