sigmaSd / IRust

Cross Platform Rust Repl
https://crates.io/crates/irust
MIT License
622 stars 34 forks source link

Use `rust-analyser` instead of `racer` for autocompletion #92

Closed Techcable closed 1 year ago

Techcable commented 2 years ago

Hi! This looks like a cool project.

Have you considered using rust-anlayser for autocompletion instead of racer? In my experience, rust-anlayser has much better autocompletion than either racer or RLS.

The racer project isn't really actively maintained, and users are more likely to have rust-analyser installed than either RLS or racer.

As of RFC 2912, rust-analyser is semi-official and there are plans to integrate it into dustup.

The best solution would probably be to use a language-server client instead of depending on it directly. The [lsp-types](https://lib.rs/crates/lsp-types crate shouldn't make this too hard 😉

Also I believe evcxr depends on the rust-analyser internal API (and requires compiling it directly).

sigmaSd commented 2 years ago

Hello, thanks for checking out the project

It is of course on my radar, I don't believe I will have time for it though

Racer have some advantages worth mentioning:

I believe that ra support needs to be added sooner or later, the only immediate problems is the work needed and that the benefit want be obvious initially to the user since irust would also need some changes to make a really good use of ra ( like maybe nicer auto completion ux, goto definition support, etc)

AddictArts commented 2 years ago

+1 racer is no longer in development as I'm sure you know. Also, it does not build anymore and using a nightly rustc is not a good experience.

sigmaSd commented 2 years ago

If someone wants to take this I think https://github.com/helix-editor/helix/tree/master/helix-lsp is the easiest implementation to copy.

sigmaSd commented 1 year ago

I'm happy to say, that I have a working prototype with ra, if some one want to test or give some technical feedback the code is here https://github.com/sigmaSd/IRust/compare/ra?expand=1

sigmaSd commented 1 year ago

PR https://github.com/sigmaSd/IRust/pull/117

AddictArts commented 1 year ago

Thank you. I will be looking at it as soon as I can, but Rust right now is personal time, so harder to get in front of me.

AddictArts commented 1 year ago

This doesn't seem to work on Windows, helix does fyi. How can I tell rust-analyzer is enabled?