Skip to content

Emacs instructions out of date, now setup just requires installing an lsp-client (eglot or lsp-mode) #196

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

Closed
meliache opened this issue Jan 25, 2023 · 0 comments

Comments

@meliache
Copy link

The emacs LSP setup documentation in manual#emacs is very of date. It's much simpler then when the instructions were written, no extra packages need to be installed other than installing an LSP client.

Emacs LSP support has grown a lot in the past years. There are two popular language servers: The first one is lsp-mode, which adds a lot of features, support LSP protocol extensions and is a bit bloated, and the lightweight
which eglot, which is more minimal, extends existing emacs functionality and has been merged into the emacs29 branch (which will be the next release).

In both popular language server implementation, rust-analyzer is the default language server for rust and no extra package or customization is required other than installing eglot or lsp-mode and enabling them. I personally prefer eglot, but lsp-mode is still fine. No lsp-rust.el is needed, that has been merged into lsp-mode and is enabled by default. It seems that the linked blog post has been updated and is still valid, so this can be linked for how to setup lsp-mode, though imo it's very opinitioned.

I think it's enough to mention the two lsp client's, what their differences are and link to their respective install/quickstart documentations and maybe a one-liner how they are typically activated

Eglot

(add-hook 'rust-mode-hook #'eglot-ensure)

LSP-Mode
Activate interactively via M-x lsp or load automatically via

(add-hook 'rust-mode-hook #'lsp-deferred)

Maybe I'll do a PR, but the caveat is that I'm not a rust dev, I just started doing rustlings. But I'm an experience emacs user and following emacs development and I recently switched from lsp-mode to eglot, so kind of know both.

meliache added a commit to meliache/rust-analyzer.github.io that referenced this issue Jan 25, 2023
Emacs has now two LSP clients, Eglot and LSP-Mode, where Eglot will soon be
shipped with Emacs. Now both have rust-analyzer enabled by default and require
no further setup then just being installed and enabled. `lsp-rust.el` is not
required anymore.

In instructions, give a one-liner how to enable each respective mode and for
configuration link to exiting documentation to avoid getting deprecated.

Resolves Issue rust-analyzer#196:
rust-analyzer#196
meliache added a commit to meliache/rust-analyzer that referenced this issue Jan 25, 2023
Emacs has now two LSP clients, the more minimalistic and lightweight Eglot and
the extensive though a bit bloated LSP-Mode. Eglot will soon be
shipped with Emacs29. Both have rust-analyzer enabled by default and require
no further setup then just being installed and enabled. `lsp-rust.el` is not
required anymore.

The base-installation for each of those modes is so easy now that I don't think
an enumerated list is necessary, both package can be installed via the standard
`M-x package-install` and the installation is a one-liner that I provide.

Configuration mostly comes into play for support the rust-analyzer extensions to
the LSP protocol, which are built into LSP mode and require an extension-package
for Eglot.

But for the configuration beyond the base configuration I link against official
documentation, quickstart guides and documentation for the lsp extensions, to
avoid showing outdated information here.

This commit is mostly a duplicate of a PR [1] that I made against the
rust-analyzer github project.

[1]: rust-analyzer/rust-analyzer.github.io#197,
     rust-analyzer/rust-analyzer.github.io@7ff0113

ma
Resolves Issue rust-lang#196:
rust-analyzer/rust-analyzer.github.io#196
lnicola added a commit that referenced this issue Aug 28, 2023
lnicola added a commit that referenced this issue Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant