Skip to content

Update emacs documentation, split into Eglot and LSP Mode #197

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
wants to merge 1 commit into from

Conversation

meliache
Copy link

@meliache meliache commented Jan 25, 2023

Emacs has now two LSP clients, Eglot and LSP-Mode, where Eglot will soon be shipped with Emacs29. Both have rust-analyzer enabled by default in their latest versions and require no further setup other than 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 this manual from getting deprecated again.

I couldn't built the documentation because of errors, it seems some dependencies are incompatible with the Ruby version 3 on Archlinux and I was too lazy to figure out how to setup up a project local ruby environment, as I never code in Ruby. Also I'm not experiences in asciidoc. I just tried to follow the style of other documentation and trusted the syntax highlighting, but it would be good if someone could check that the docs built nicely and the generated html is ok (no unexpected linebreaks, working syntax highlighting).

Resolves #196

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
@lnicola
Copy link
Member

lnicola commented Jan 25, 2023

Thank you, but can you please file this against https://github.com/rust-lang/rust-analyzer?

@meliache
Copy link
Author

Thanks, will do 👍

I'm new to rust, which is why I was reading the setup documentation. Heard about rust-analyzer being merged into rust-lang, but thought the docs still are separate. I still land on this repo when I open https://rust-analyzer.github.io, which is linked in the latest rust-lang/rust-analyzer readme, and click on the github source icon on the bottom.

I'm not sure what the status of this repo is, but if it's supposed to not be used anymore, consider archiving and closing of new PR's. Anyway, I found the equivalent emacs section in https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/manual.adoc#emacs, so I'll create my PR which fixes this against that.

@meliache meliache closed this Jan 25, 2023
meliache added a commit to meliache/rust-analyzer that referenced this pull request 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
meliache added a commit to meliache/rust-analyzer that referenced this pull request 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
@lnicola
Copy link
Member

lnicola commented Jan 25, 2023

I still land on this repo when I open https://rust-analyzer.github.io/

Yes, but look at the note (next to the light bulb) at the top of https://rust-analyzer.github.io/manual.html. The manual lives in the main RA repo, and is copied here on each release.

This repo is still used for the rest of https://rust-analyzer.github.io/ (release notes and blog posts, mostly).

meliache added a commit to meliache/rust-analyzer that referenced this pull request 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

Spelling: Space before version number in Emacs 29 in manual

Co-authored-by: Laurențiu Nicola <[email protected]>
bors added a commit to rust-lang/rust-analyzer that referenced this pull request Jan 25, 2023
…nicola

Update documentation for emacs and split it for LSP-mode and Eglot

Emacs has now two LSP clients, the more minimalistic and lightweight [Eglot](https://joaotavora.github.io/eglot) and the extensive though a bit bloated [LSP Mode](https://github.com/emacs-lsp/lsp-mode). Eglot will soon be shipped with Emacs29. Both have rust-analyzer enabled by default and require no further setup other then 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 packages can be installed via the standard `M-x package-install` and the installation is a one-liner that I provide.

Configuration is only necessary for supporting the rust-analyzer extensions to the LSP protocol, which are built into LSP mode and require an [extension-package](https://github.com/nemethf/eglot-x) for Eglot.

But for further documentation, including the LSP extensions, I link against official documentation where possible to avoid duplicating efforts having to continually update this to stay up-to-date.

I rewrote most of the original emacs documentation, but the [linked blog](https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/) post by `@rksm` seems still being actively updated with updates to LSP mode, so I kept the link. That blog post is opinionated, I personally use different packages which achieve similar end results (Eglot instead of LSP-mode, corfu instead of capf, vertico instead of helm etc.). But if someone doesn't already have an extensive Emacs configuration, I think this is not a bad starting point.

Disclaimer: I'm a Rust beginner, which is why I read the rust-analyzer setup docs. So I necessarily know how most Rust experts use Emacs. But I'm an experienced Emacs user who uses several other programming languages via LSP-mode support in Emacs. I used both, initially LSP-mode and recently migrated to Eglot.

Also I'm not an experienced in writing asciidoc and I didn't do a local test-built, hopefully the html builds in the way I imagine it. So I recommend to check that aspect of the PR. Maybe the documentation is in the CI build-artifacts?

This is a duplicate of a PR to the old rust-analyzer project rust-analyzer/rust-analyzer.github.io#197, which I made because I didn't know that the documentation now lives here.
lnicola added a commit that referenced this pull request Sep 4, 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 this pull request may close these issues.

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