Skip to content

Commit 827630e

Browse files
committed
Changelog #154
1 parent 38c4292 commit 827630e

File tree

5 files changed

+99
-7
lines changed

5 files changed

+99
-7
lines changed

generated_assists.adoc

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn main() {
2323

2424
[discrete]
2525
=== `add_hash`
26-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L91[raw_string.rs]
26+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L88[raw_string.rs]
2727

2828
Adds a hash to a raw string literal.
2929

@@ -477,6 +477,30 @@ fn main() {
477477
```
478478

479479

480+
[discrete]
481+
=== `convert_match_to_let_else`
482+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_match_to_let_else.rs#L12[convert_match_to_let_else.rs]
483+
484+
Converts let statement with match initializer to let-else statement.
485+
486+
.Before
487+
```rust
488+
fn foo(opt: Option<()>) {
489+
let val = ┃match opt {
490+
Some(it) => it,
491+
None => return,
492+
};
493+
}
494+
```
495+
496+
.After
497+
```rust
498+
fn foo(opt: Option<()>) {
499+
let Some(val) = opt else { return };
500+
}
501+
```
502+
503+
480504
[discrete]
481505
=== `convert_named_struct_to_tuple_struct`
482506
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_named_struct_to_tuple_struct.rs#L11[convert_named_struct_to_tuple_struct.rs]
@@ -788,7 +812,7 @@ enum A { One(One) }
788812

789813
[discrete]
790814
=== `extract_type_alias`
791-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_type_alias.rs#L11[extract_type_alias.rs]
815+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_type_alias.rs#L10[extract_type_alias.rs]
792816

793817
Extracts the selected type as a type alias.
794818

@@ -1522,7 +1546,7 @@ impl Person {
15221546

15231547
[discrete]
15241548
=== `inline_call`
1525-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L159[inline_call.rs]
1549+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L161[inline_call.rs]
15261550

15271551
Inlines a function or method body creating a `let` statement per parameter unless the parameter
15281552
can be inlined. The parameter will be inlined either if it the supplied argument is a simple local
@@ -1548,7 +1572,7 @@ fn foo(name: Option<&str>) {
15481572

15491573
[discrete]
15501574
=== `inline_into_callers`
1551-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L25[inline_call.rs]
1575+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L27[inline_call.rs]
15521576

15531577
Inline a function or method body into all of its callers where possible, creating a `let` statement per parameter
15541578
unless the parameter can be inlined. The parameter will be inlined either if it the supplied argument is a simple local
@@ -1778,7 +1802,7 @@ fn main() {
17781802

17791803
[discrete]
17801804
=== `make_usual_string`
1781-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L49[raw_string.rs]
1805+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L46[raw_string.rs]
17821806

17831807
Turns a raw string into a plain string.
17841808

@@ -2183,7 +2207,7 @@ fn main() {
21832207

21842208
[discrete]
21852209
=== `remove_hash`
2186-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L119[raw_string.rs]
2210+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L116[raw_string.rs]
21872211

21882212
Removes a hash from a raw string literal.
21892213

generated_config.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
[[rust-analyzer.assist.emitMustUse]]rust-analyzer.assist.emitMustUse (default: `false`)::
2+
+
3+
--
4+
Whether to insert #[must_use] when generating `as_` methods
5+
for enum variants.
6+
--
17
[[rust-analyzer.assist.expressionFillDefault]]rust-analyzer.assist.expressionFillDefault (default: `"todo"`)::
28
+
39
--

generated_features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ The simplest way to use this feature is via the context menu:
572572

573573

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

577577
Renames the item below the cursor and all of its references
578578

manual.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,12 @@ https://docs.helix-editor.com/[Helix] supports LSP by default.
487487
However, it won't install `rust-analyzer` automatically.
488488
You can follow instructions for installing <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
489489

490+
=== Crates
491+
492+
There is a package named `ra_ap_rust_analyzer` available on https://crates.io/crates/ra_ap_rust-analyzer[crates.io], for someone who wants to use it programmatically.
493+
494+
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
495+
490496
== Troubleshooting
491497

492498
Start with looking at the rust-analyzer version.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
= Changelog #154
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:d03c1c87d4ca2d524646316387d47b12524ac451[] +
6+
Release: release:2022-11-07[]
7+
8+
== An Update on OpenVSX ==
9+
10+
Many users of VS Code are actually running an open-source version of the editor.
11+
These include VSCodium and the `code` package in Arch Linux.
12+
The "free" builds are not allowed to connect to the Microsoft Marketplace and instead they download extensions from https://open-vsx.org[OpenVSX].
13+
14+
For a long time, the version of rust-analyzer available on OpenVSX was outdated and did not work very well with recent Rust toolchains.
15+
But because of various technical reasons, we were not able to publish new versions there.
16+
This caused countless of disappointed users, and dozens of duplicate issues filed against our tracker.
17+
18+
Last week, with the help of the OpenVSX maintainers, we managed to sort out the issues.
19+
And for the first time in almost a year, rust-analyzer is https://open-vsx.org/extension/rust-lang/rust-analyzer[available] on OpenVSX.
20+
Unfortunately, we had to remove the existing versions, under the identifier of `matklad.rust-analyzer`.
21+
If you have that version installed, it will not be automatically switched over to the new one (`rust-lang.rust-analyzer`).
22+
23+
So if you are not running a Microsoft build of VS Code, our advice is to reinstall rust-analyzer from Code's extension page.
24+
This will ensure that you get updated versions in the future.
25+
If you've installed a VSIX from GitHub since March, it should get updated automatically, but it doesn't hurt to check.
26+
27+
If you are using an official build of Code, or a different editor, you don't need to take any action.
28+
29+
== New Features
30+
31+
* pr:13525[] show signature help when calling generic types implementing `FnOnce`:
32+
+
33+
image::https://user-images.githubusercontent.com/308347/200243832-b81303bd-b833-4d99-b96c-ecec6acdc2df.png["A screenshot showing signature help when calling a `FnOnce` parameter"]
34+
* pr:13516[] add "Convert `match` to `let`-``else``" assist:
35+
+
36+
video::https://user-images.githubusercontent.com/308347/200244795-545f0465-ec0f-4d8c-8f70-5f08aea99bf0.mp4[options=loop]
37+
* pr:13527[] use `let`-`else` statements in "Convert to guarded return".
38+
* pr:13359[] add `rust-analyzer.assist.emitMustUse` config for inserting `#[must_use]` in `generate_enum_as_method`.
39+
40+
== Fixes
41+
42+
* pr:13454[] (first contribution) handle shadowing of locals in "Inline call".
43+
* pr:13508[] (first contribution) don't offer to remove unnecessary `async` in trait items.
44+
* pr:13523[] disregard type variable expectation for `if` expressions.
45+
* pr:13546[] lower unsafety of function pointer and item types.
46+
* pr:13517[] make custom expression prefix completions understand references.
47+
* pr:13549[] fix reference searching accounting for substrings instead of whole identifiers.
48+
* pr:13456[] generate SCIP symbols for local crates.
49+
50+
== Internal Improvements
51+
52+
* pr:13445[] (first contribution) fix some broken links in `guide.md`.
53+
* pr:13536[], pr:13556[] (first contribution) mention auto-published crates in the manual.
54+
* pr:13379[], pr:13435[] migrate assists to format args captures, parts 1 and 3.
55+
* pr:13544[] add rustbot features related to PR state labels.
56+
* pr:13541[] clarify which VS Code commands are meant for debugging.

0 commit comments

Comments
 (0)