Skip to content

Change Rust language server to rust-analyzer and drop RLS support#803

Merged
skangas merged 1 commit into
masterfrom
rust-analyzer
Jan 17, 2022
Merged

Change Rust language server to rust-analyzer and drop RLS support#803
skangas merged 1 commit into
masterfrom
rust-analyzer

Conversation

@skangas
Copy link
Copy Markdown
Collaborator

@skangas skangas commented Jan 14, 2022

As discussed in #800.

rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

  • eglot.el (eglot-server-programs): Change rust-mode language server
    from rls to rust-analyzer.
    (eglot-rls, jsonrpc-connection-ready-p)
    (eglot-handle-notification): Delete.
  • README.md: Update references for RLS to point to rust-analyzer.

@skangas skangas changed the title Change Rust language server to rust-analyzer, drop rls Change Rust language server to rust-analyzer and drop RLS support Jan 14, 2022
skangas added a commit that referenced this pull request Jan 14, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Change rust-mode language server
from rls to rust-analyzer.
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
@skangas
Copy link
Copy Markdown
Collaborator Author

skangas commented Jan 14, 2022

@joaotavora WDYT?

@skangas skangas requested a review from joaotavora January 14, 2022 12:12
@joaotavora
Copy link
Copy Markdown
Owner

Seems very good, but not enough. There is a test in eglot-tests.el based on rls that would have to be changed to rely on some other server (not necessarily rust).

@joaotavora
Copy link
Copy Markdown
Owner

Also, we should somehow make sure that rust-analyzer IS supported. I'm reasonably sure I've seen issues around here doing that and confirming check, but we should double check.

@theothornhill
Copy link
Copy Markdown
Collaborator

I've used rust-analyzer with eglot reliably at work

skangas added a commit that referenced this pull request Jan 14, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Change rust-mode language server
from rls to rust-analyzer.
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete.

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
@skangas
Copy link
Copy Markdown
Collaborator Author

skangas commented Jan 14, 2022

@theothornhill That's useful information, thanks.

Updating the tests was pretty trivial, see the updated PR. Everything passes here, of course.

@nemethf
Copy link
Copy Markdown
Collaborator

nemethf commented Jan 14, 2022

At first glance, it seems the deleted code is not strictly necessary for rls to work to some extent. So maybe it should be (eglot-alternatives '("rust-analyzer" "rls"))? Then the change is a more graceful deprecation. But I haven't actually tried what happens when eglot doesn't wait for the indexing to finish. So, to contradict myself, maybe half supporting rls isn't worth the trouble.

@joaotavora
Copy link
Copy Markdown
Owner

But I haven't actually tried what happens when eglot doesn't wait for the indexing to finish.

If I remember correctly, typing something quickly and then waiting for completions failed, because the completion provided wasn't aware of the things you had typed in the meantime, because indexing wasn't done. Seems a problem most other LSP servers would have, and RLS was the only one that had that particular quirk (which they solved in their VSCode extension, too).

(yes they had a VSCode "reference implementation"... so much for LSP 🤷 )

@skangas
Copy link
Copy Markdown
Collaborator Author

skangas commented Jan 15, 2022

IIUC, rls would need this workaround because they compile everything first, and then use that data to provide LSP completions, etc. Whereas rust-analyzer compiles things on the fly. So if we want to keep rls around, I think we should also keep that extra supporting code as well.

skangas added a commit that referenced this pull request Jan 15, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Change rust-mode language server
from rls to rust-analyzer.
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete.

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
@nemethf
Copy link
Copy Markdown
Collaborator

nemethf commented Jan 15, 2022

Having removed the rls specific code from Eglot I opened a very simple rust file and xref-find-definitions worked. So I think keeping rls at the end of the alternatives list is somewhat useful in some cases even without extra supporting code. But I'm also OK with completely removing the rls support.

skangas added a commit that referenced this pull request Jan 15, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Change rust-mode language server
from rls to rust-analyzer.
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete.

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
skangas added a commit that referenced this pull request Jan 15, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Add rust-mode language server
"rust-analyzer" and prefer it to the older "rls".
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete special support for "rls".

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
@skangas
Copy link
Copy Markdown
Collaborator Author

skangas commented Jan 15, 2022

I've pushed a new version which keeps rls in eglot-server-programs, but removes the support code.

@joaotavora
Copy link
Copy Markdown
Owner

I think this is good to go. We should to something about the rls -using test later. But I don't think that test relies on the RLS's support code either.

@skangas
Copy link
Copy Markdown
Collaborator Author

skangas commented Jan 17, 2022

I think this is good to go. We should to something about the rls -using test later. But I don't think that test relies on the RLS's support code either.

Unless I'm missing something, I've changed those tests to use rust-analyzer.

@joaotavora
Copy link
Copy Markdown
Owner

Unless I'm missing something, I've changed those tests to use rust-analyzer.

Clearly, I was missing something :-D

Comment thread eglot-tests.el Outdated
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Add rust-mode language server
"rust-analyzer" and prefer it to the older "rls".
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete special support for "rls".

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
@skangas skangas merged commit 8ee2179 into master Jan 17, 2022
bhankas pushed a commit to bhankas/emacs that referenced this pull request Sep 18, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Add rust-mode language server
"rust-analyzer" and prefer it to the older "rls".
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete special support for "rls".

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
bhankas pushed a commit to bhankas/emacs that referenced this pull request Sep 19, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Add rust-mode language server
"rust-analyzer" and prefer it to the older "rls".
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete special support for "rls".

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
bhankas pushed a commit to bhankas/emacs that referenced this pull request Sep 19, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Add rust-mode language server
"rust-analyzer" and prefer it to the older "rls".
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete special support for "rls".

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.

#803: joaotavora/eglot#803
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this pull request Oct 12, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Add rust-mode language server
"rust-analyzer" and prefer it to the older "rls".
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete special support for "rls".

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.

GitHub-reference: per joaotavora/eglot#803
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this pull request Oct 20, 2022
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Add rust-mode language server
"rust-analyzer" and prefer it to the older "rls".
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete special support for "rls".

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.

GitHub-reference: per joaotavora/eglot#803
pawelkobojek pushed a commit to pawelkobojek/penteglot that referenced this pull request Oct 13, 2025
rust-analyzer is the officially blessed Language Server for Rust:
rust-lang/rfcs#2912

Also drop the special support code for RLS.

* eglot.el (eglot-server-programs): Add rust-mode language server
"rust-analyzer" and prefer it to the older "rls".
(eglot-rls, jsonrpc-connection-ready-p)
(eglot-handle-notification): Delete special support for "rls".

* eglot-tests.el (rls-analyzer-watches-files)
(rls-analyzer-hover-after-edit): Rename to ...
(rust-analyzer-watches-files)
(rust-analyzer-hover-after-edit): ... this.  Update tests to work
with rust-analyzer.
* README.md: Update references for RLS to point to rust-analyzer.
* NEWS.md: Announce above change.
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

Successfully merging this pull request may close these issues.

4 participants