Skip to content

Commit 8067a31

Browse files
committed
Changelog #99
1 parent be49044 commit 8067a31

File tree

4 files changed

+156
-6
lines changed

4 files changed

+156
-6
lines changed

generated_assists.adoc

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ struct Point<'a> {
141141

142142
[discrete]
143143
=== `add_missing_match_arms`
144-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_missing_match_arms.rs#L15[add_missing_match_arms.rs]
144+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_missing_match_arms.rs#L16[add_missing_match_arms.rs]
145145

146146
Adds missing clauses to a `match` expression.
147147

@@ -583,7 +583,7 @@ fn qux(bar: Bar, baz: Baz) {}
583583

584584
[discrete]
585585
=== `extract_function`
586-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L33[extract_function.rs]
586+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L38[extract_function.rs]
587587

588588
Extracts selected statements into new function.
589589

@@ -854,6 +854,47 @@ impl Default for Example {
854854
```
855855

856856

857+
[discrete]
858+
=== `generate_delegate_methods`
859+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_delegate_methods.rs#L10[generate_delegate_methods.rs]
860+
861+
Generate delegate methods.
862+
863+
.Before
864+
```rust
865+
struct Age(u8);
866+
impl Age {
867+
fn age(&self) -> u8 {
868+
self.0
869+
}
870+
}
871+
872+
struct Person {
873+
ag┃e: Age,
874+
}
875+
```
876+
877+
.After
878+
```rust
879+
struct Age(u8);
880+
impl Age {
881+
fn age(&self) -> u8 {
882+
self.0
883+
}
884+
}
885+
886+
struct Person {
887+
age: Age,
888+
}
889+
890+
impl Person {
891+
┃fn age(&self) -> u8 {
892+
self.age.age()
893+
}
894+
}
895+
```
896+
897+
857898
[discrete]
858899
=== `generate_deref`
859900
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_deref.rs#L15[generate_deref.rs]
@@ -1645,6 +1686,40 @@ fn t() {}
16451686
```
16461687

16471688

1689+
[discrete]
1690+
=== `promote_local_to_const`
1691+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/promote_local_to_const.rs#L19[promote_local_to_const.rs]
1692+
1693+
Promotes a local variable to a const item changing its name to a `SCREAMING_SNAKE_CASE` variant
1694+
if the local uses no non-const expressions.
1695+
1696+
.Before
1697+
```rust
1698+
fn main() {
1699+
let foo┃ = true;
1700+
1701+
if foo {
1702+
println!("It's true");
1703+
} else {
1704+
println!("It's false");
1705+
}
1706+
}
1707+
```
1708+
1709+
.After
1710+
```rust
1711+
fn main() {
1712+
const ┃FOO: bool = true;
1713+
1714+
if FOO {
1715+
println!("It's true");
1716+
} else {
1717+
println!("It's false");
1718+
}
1719+
}
1720+
```
1721+
1722+
16481723
[discrete]
16491724
=== `pull_assignment_up`
16501725
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/pull_assignment_up.rs#L11[pull_assignment_up.rs]
@@ -1955,7 +2030,7 @@ fn compute() -> Option<i32> { None }
19552030

19562031
[discrete]
19572032
=== `replace_match_with_if_let`
1958-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_if_let_with_match.rs#L158[replace_if_let_with_match.rs]
2033+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_if_let_with_match.rs#L160[replace_if_let_with_match.rs]
19592034

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

@@ -2223,6 +2298,23 @@ fn foo() {
22232298
```
22242299

22252300

2301+
[discrete]
2302+
=== `unwrap_result_return_type`
2303+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/unwrap_result_return_type.rs#L9[unwrap_result_return_type.rs]
2304+
2305+
Unwrap the function's return type.
2306+
2307+
.Before
2308+
```rust
2309+
fn foo() -> Result<i32>┃ { Ok(42i32) }
2310+
```
2311+
2312+
.After
2313+
```rust
2314+
fn foo() -> i32 { 42i32 }
2315+
```
2316+
2317+
22262318
[discrete]
22272319
=== `wrap_return_type_in_result`
22282320
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/wrap_return_type_in_result.rs#L11[wrap_return_type_in_result.rs]

generated_config.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,13 @@ tests or binaries. For example, it may be `--release`.
420420
+
421421
--
422422
Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private
423-
projects, or "discover" to try to automatically find it.
423+
projects, or "discover" to try to automatically find it if the `rustc-dev` component
424+
is installed.
424425

425426
Any project which uses rust-analyzer with the rustcPrivate
426427
crates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.
427428

428-
This option is not reloaded automatically; you must restart rust-analyzer for it to take effect.
429+
This option does not take effect until rust-analyzer is restarted.
429430
--
430431
[[rust-analyzer.rustfmt.extraArgs]]rust-analyzer.rustfmt.extraArgs (default: `[]`)::
431432
+

generated_features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ be parsed as a valid structural search and replace rule.
799799

800800

801801
=== User Snippet Completions
802-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/snippet.rs#L5[snippet.rs]
802+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/snippet.rs#L7[snippet.rs]
803803

804804
rust-analyzer allows the user to define custom (postfix)-snippets that may depend on items to be accessible for the current scope to be applicable.
805805

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
= Changelog #99
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:91cbda43c2af82b9377eff70a21f59ade18cd23c[] +
6+
Release: release:2021-10-18[]
7+
8+
== Sponsors
9+
10+
**Become a sponsor:** On https://opencollective.com/rust-analyzer/[OpenCollective] or
11+
https://github.com/sponsors/rust-analyzer[GitHub Sponsors].
12+
13+
== New Features
14+
15+
* pr:10529[] generate `PartialOrd` implementations:
16+
+
17+
image::https://user-images.githubusercontent.com/308347/137682192-12f729c3-c70b-456e-9b6c-a92fa4ea275f.gif[]
18+
* pr:10434[] allow `Locate parent module` in `Cargo.toml`:
19+
+
20+
image::https://user-images.githubusercontent.com/308347/137682837-46cb51b3-f6fa-41b1-b947-ae65f9a6509c.gif[]
21+
* pr:10539[] add "Generate delegate methods" assist:
22+
+
23+
image::https://user-images.githubusercontent.com/3757771/137555191-2f9ff184-a235-4afb-87c7-aa03cea4a96f.gif[]
24+
* pr:10546[] implement "Promote local to const" assist:
25+
+
26+
image::https://user-images.githubusercontent.com/3757771/137555943-51a11a43-5e8f-4309-8178-417b677d74ad.gif[]
27+
* pr:10417[] add "Unwrap `Result` return type" assist:
28+
+
29+
image::https://user-images.githubusercontent.com/308347/137636737-06a3d47d-f647-45dd-85a2-fe0579ef24a7.gif[]
30+
31+
== Fixes
32+
33+
* pr:10519[] (first contribution) set `toolinfo` in LSIF export.
34+
* pr:10522[] (first contribution) fix serialization of `SignatureHelp` response.
35+
* pr:10534[] (first contribution) improve logo rendering on dark backgrounds.
36+
* pr:10538[] (first contribution) make brace matching prefer the one to the right of the cursor.
37+
* pr:10542[] (first contribution) use workspace `cargo` to fetch `rust-src` metadata.
38+
* pr:10543[] (first contribution) narrow "Add missing match arms" assist range.
39+
* pr:10533[] fix `AssistContext` panic on sole whitespace selection.
40+
* pr:10503[] only include targets of packages that are workspace members.
41+
* pr:10517[] report `cargo check` failures.
42+
* pr:10491[] support nested type in "Replace `if-let` with ``match``".
43+
* pr:10552[] fix "Missing fields" diagnostic fix replacing wrong text ranges.
44+
* pr:10557[] fix qualified path completion not completing macros.
45+
* pr:10562[] fix clippy attribute completions always inserting `clippy::`.
46+
* pr:10569[] skip non clippy completions when completing a clippy path.
47+
48+
== Internal Improvements
49+
50+
* pr:10532[] (first contribution) rename `descend_into_macros` functions.
51+
* pr:10525[] regenerate lints and features.
52+
* pr:10526[] improve user snippet import performance.
53+
* pr:10528[], pr:10533[] make selections in assists with trailing/leading whitespace more forgiving.
54+
* pr:10423[] refactor for `mdbook` plugin.
55+
* pr:10309[] use `ControlFlow` in "Extract function" assist.
56+
* pr:10558[] refactor lifetime completion context fields.
57+
* pr:10561[] don't turn local names into strings in `CompletionContext`.

0 commit comments

Comments
 (0)