Skip to content

Commit b432b05

Browse files
committed
Changelog #166
1 parent ec3b7ba commit b432b05

File tree

4 files changed

+82
-11
lines changed

4 files changed

+82
-11
lines changed

generated_assists.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ fn apply<T, U, F>(f: F, x: T) -> U where F: FnOnce(T) -> U {
20392039

20402040
[discrete]
20412041
=== `move_const_to_impl`
2042-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_const_to_impl.rs#L17[move_const_to_impl.rs]
2042+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_const_to_impl.rs#L14[move_const_to_impl.rs]
20432043

20442044
Move a local constant item in a method to impl's associated constant. All the references will be
20452045
qualified with `Self::`.
@@ -2639,7 +2639,7 @@ fn compute() -> Option<i32> { None }
26392639

26402640
[discrete]
26412641
=== `replace_match_with_if_let`
2642-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_if_let_with_match.rs#L174[replace_if_let_with_match.rs]
2642+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_if_let_with_match.rs#L185[replace_if_let_with_match.rs]
26432643

26442644
Replaces a binary `match` with a wildcard pattern and no guards with an `if let` expression.
26452645

@@ -3026,7 +3026,7 @@ fn main() {
30263026

30273027
[discrete]
30283028
=== `unwrap_block`
3029-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unwrap_block.rs#L11[unwrap_block.rs]
3029+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unwrap_block.rs#L12[unwrap_block.rs]
30303030

30313031
This assist removes if...else, for, while and loop control statements to just keep the body.
30323032

generated_features.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ The simplest way to use this feature is via the context menu:
574574

575575

576576
=== Rename
577-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/rename.rs#L67[rename.rs]
577+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/rename.rs#L73[rename.rs]
578578

579579
Renames the item below the cursor and all of its references
580580

manual.adoc

+41-7
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,43 @@ $ brew install rust-analyzer
234234

235235
=== Emacs
236236

237-
Note this excellent https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/[guide] from https://github.com/rksm[@rksm].
238-
239237
Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
240238

241-
Emacs support is maintained as part of the https://github.com/emacs-lsp/lsp-mode[Emacs-LSP] package in https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-rust.el[lsp-rust.el].
239+
To use `rust-analyzer`, you need to install and enable one of the two popular two popular LSP client implementations for Emacs, https://github.com/joaotavora/eglot[Eglot] or https://github.com/emacs-lsp/lsp-mode[LSP Mode]. Both enable `rust-analyzer` by default in rust buffers if it is available.
240+
241+
==== Eglot
242+
243+
Eglot is the more minimalistic and lightweight LSP client for Emacs, integrates well with existing Emacs functionality and will be built into Emacs starting from release 29.
244+
245+
After installing Eglot, e.g. via `M-x package-install` (not needed from Emacs 29), you can enable it via the `M-x eglot` command or load it automatically in `rust-mode` via
246+
247+
[source,emacs-lisp]
248+
----
249+
(add-hook 'rust-mode-hook 'eglot-ensure)
250+
----
251+
252+
For more detailed instructions and options see the https://joaotavora.github.io/eglot[Eglot manual] (also available from Emacs via `M-x info`) and the
253+
https://github.com/joaotavora/eglot/blob/master/README.md[Eglot readme].
254+
255+
Eglot does not support the rust-analyzer extensions to the language-server protocol and does not aim to do so in the future. The https://github.com/nemethf/eglot-x#rust-analyzer-extensions[eglot-x] package adds experimental support for those LSP extensions.
242256

243-
1. Install the most recent version of `emacs-lsp` package by following the https://github.com/emacs-lsp/lsp-mode[Emacs-LSP instructions].
244-
2. Set `lsp-rust-server` to `'rust-analyzer`.
245-
3. Run `lsp` in a Rust buffer.
246-
4. (Optionally) bind commands like `lsp-rust-analyzer-join-lines`, `lsp-extend-selection` and `lsp-rust-analyzer-expand-macro` to keys.
257+
==== LSP Mode
258+
259+
LSP-mode is the original LSP-client for emacs. Compared to Eglot it has a larger codebase and supports more features, like LSP protocol extensions.
260+
With extension packages like https://github.com/emacs-lsp/lsp-mode[LSP UI] it offers a lot of visual eyecandy.
261+
Further it integrates well with https://github.com/emacs-lsp/dap-mode[DAP mode] for support of the Debug Adapter Protocol.
262+
263+
You can install LSP-mode via `M-x package-install` and then run it via the `M-x lsp` command or load it automatically in rust buffers with
264+
265+
[source,emacs-lisp]
266+
----
267+
(add-hook 'rust-mode-hook 'lsp-deferred)
268+
----
269+
270+
For more information on how to set up LSP mode and its extension package see the instructions in the https://emacs-lsp.github.io/lsp-mode/page/installation[LSP mode manual].
271+
Also see the https://emacs-lsp.github.io/lsp-mode/page/lsp-rust-analyzer/[rust-analyzer section] for `rust-analyzer` specific options and commands, which you can optionally bind to keys.
272+
273+
Note the excellent https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/[guide] from https://github.com/rksm[@rksm] on how to set-up Emacs for Rust development with LSP mode and several other packages.
247274

248275
=== Vim/NeoVim
249276

@@ -493,6 +520,13 @@ There is a package named `ra_ap_rust_analyzer` available on https://crates.io/cr
493520

494521
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
495522

523+
=== Visual Studio IDE
524+
525+
Support for Rust development in the Visual Studio IDE is enabled by the link:https://marketplace.visualstudio.com/items?itemName=kitamstudios.RustAnalyzer[rust-analyzer] package. Either click on the download link or install from IDE's extension manager.
526+
For now link:https://visualstudio.microsoft.com/downloads/[Visual Studio 2022] is required. All editions are supported viz. Community, Professional & Enterprise.
527+
The package aims to provide 0-friction installation and therefore comes loaded with most things required including rust-analyzer binary. If anything it needs is missing, appropriate errors / warnings will guide the user. E.g. cargo.exe needs to be in path and the package will tell you as much.
528+
This package is under rapid active development. So if you encounter any issues please file it at link:https://github.com/kitamstudios/rust-analyzer/[rust-analyzer.vs].
529+
496530
== Troubleshooting
497531

498532
Start with looking at the rust-analyzer version.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
= Changelog #166
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:f1b257f4eb4fef74b42fd7135d1cf3884e8b51c9[] +
7+
Release: release:2023-01-30[] (`0.3.1386`)
8+
9+
== New Features
10+
11+
* pr:14012[] (first contribution) add installation instructions for Visual Studio.
12+
* pr:14024[] (first contribution) update documentation for Emacs.
13+
* pr:14041[] show signature help for record literals:
14+
+
15+
image::https://user-images.githubusercontent.com/1786438/215165358-8e51cd1a-d7c3-4c9d-a2d8-c22638bcf500.png["Screenshot showing signature help for the fields in a struct literal"]
16+
* pr:14007[] add "Open server logs" button to the error notification:
17+
+
18+
image::https://user-images.githubusercontent.com/3757771/214038673-658f3b43-5310-47b0-99da-d3222d173b0c.gif["Screen recording showing a button that opens the logs when `cargo check` fails to run"]
19+
20+
== Fixes
21+
22+
* pr:14015[] (first contribution) don't include lifetime or label apostrophe when renaming.
23+
* pr:14020[] fix associated item search finding unrelated definitions.
24+
* pr:14006[] replace soft breaks in Markdown with spaces.
25+
* pr:14019[], pr:14023[] substitute VS Code variables more generally
26+
* pr:14004[] don't escape non-snippets in `Move const to impl`.
27+
* pr:14011[] fix `Unwrap block` for `let` statements.
28+
* pr:14037[] handle boolean scrutinees better in `Match to if-let` assist.
29+
* pr:14039[] make `Add missing impl members` work for impls inside blocks.
30+
* pr:14038[] don't fail workspace loading if sysroot can't be found
31+
32+
== Internal Improvements
33+
34+
* pr:14025[] improve deduplication in `process_changes`.
35+
* pr:14009[] 🧹 `lsp_ext.ts`.
36+
* pr:14017[] remove `TypeWalk`.
37+
* pr:14026[] try to fix auto-publishing of lib crates.

0 commit comments

Comments
 (0)