Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Rust Analyzer Support #127

Closed
sunjay opened this issue Apr 3, 2019 · 15 comments · Fixed by #157
Closed

Rust Analyzer Support #127

sunjay opened this issue Apr 3, 2019 · 15 comments · Fixed by #157

Comments

@sunjay
Copy link
Member

sunjay commented Apr 3, 2019

Hi,
I use this plugin daily and often run into slowness/lagging due to the enormous memory consumption of RLS on my platform. Would it be possible (even experimentally) add support for using Rust Analyzer instead of RLS?

It would be fine to require the user to install it themselves since it has to be built from source. I am very interested in seeing if this makes using atom for Rust more enjoyable.

Thanks for working on this plugin! I use it every day. 😄

@alexheretic
Copy link
Member

Recently it's seemed a lot worse. On Linux at least. Nightly versions of rls are using lots of ram and seems to be causing atom to consume lots of memory too. I currently don't understand the cause of this, there are long running issues upstream that seem to have stalled.

I'd try using older rls versions before it started performing quite so poorly. Or maybe try switching to stable.

I haven't been following rust analyser closely enough to know if it can perform as a language server. But if I remember the project properly I can't see how it can provide compiler & clippy diagnostics.

@sunjay
Copy link
Member Author

sunjay commented Apr 3, 2019

According the user docs for Rust Analyzer, it seems to support language server. There are plugins for both VS Code and Emacs. I'm not sure about clippy integration. Maybe that's a reason for this to just get added experimentally for the timebeing.

I'm on Linux too. It looks you were actually the one who filed the RLS issue about the memory regression on Linux. 😅

@alexheretic
Copy link
Member

I'm it's current state I'd say rust analyser would be better served by a separate atom package. I don't see a lot of crossover other than the standard lsp stuff which is already provided by atom-languageclient.

For rls performance it should be a lot better, it should be as fast as cargo check --all-targets and consume no more memory. I think rls running cargo/rustc in a separate process will help a lot.

Unfortunately I don't have much time to investigate rls performance or experiment with rust analyser.

@appelgriebsch
Copy link

Hey, looks like you can override the command to be triggered in your atom config.cson:

  "ide-rust":
    rlsCommandOverride: "ra_lsp_server"

@GrayJack
Copy link

GrayJack commented Jul 3, 2019

@appelgriebsch Looks like overriding it doesn't work, it doesn't show any errors

@GrayJack
Copy link

GrayJack commented Sep 2, 2019

There is a way to run both at the same time?

@extraymond
Copy link

Anyone know how to get linting and fmt to work?

@extraymond
Copy link

Updates, it seems to work with the latest build.
Linting/autocomplete/hyperclick all works.

@sunjay
Copy link
Member Author

sunjay commented Mar 18, 2020

Note that ra_lsp_server is just called rust-analyzer now, so put the following in your config:

  "ide-rust":
    rlsCommandOverride: "rust-analyzer"

Basic errors and stuff works, but code fixes do not. It's much faster than rls which was starting to take a minute or two (or much more) on my machine. Rust analyzer is almost instant.

@GrayJack
Copy link

GrayJack commented Mar 19, 2020

And lack clippy lints, but outside that, pretty good

@sunjay
Copy link
Member Author

sunjay commented Apr 21, 2020

It looks like Rust Analyzer is becoming the official Language Server implementation for Rust. It would be great if the Rust atom plugin had better support for it going forward given that it will likely replace RLS in the future. If there are certain features that are harder to implement or otherwise incomplete with rust-analyser, now is the time for us to voice those concerns and get them addressed.

The current experience with rust-analyzer in atom isn't great. I would love to see us improve that. :)

@alexheretic
Copy link
Member

Yep it's clear rust-analyzer is the future.

I think I'll wait until it's riding the release trains, at least available on the nightly channel, before starting to code the switch.

@sunjay
Copy link
Member Author

sunjay commented Apr 23, 2020

Thanks Alex! Let us know how we can all help :)

@alexheretic
Copy link
Member

Initial support available in v0.22.0-beta.1

@sunjay
Copy link
Member Author

sunjay commented May 11, 2020

Thanks @alexheretic!

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

Successfully merging a pull request may close this issue.

5 participants