Skip to content

Commit 3712810

Browse files
committed
Changelog #249
1 parent ba03cd1 commit 3712810

File tree

6 files changed

+135
-7
lines changed

6 files changed

+135
-7
lines changed

generated_assists.adoc

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,33 @@ fn main() {
460460
```
461461

462462

463+
[discrete]
464+
=== `convert_closure_to_fn`
465+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_closure_to_fn.rs#L25[convert_closure_to_fn.rs]
466+
467+
This converts a closure to a freestanding function, changing all captures to parameters.
468+
469+
.Before
470+
```rust
471+
fn main() {
472+
let mut s = String::new();
473+
let closure = |┃a| s.push_str(a);
474+
closure("abc");
475+
}
476+
```
477+
478+
.After
479+
```rust
480+
fn main() {
481+
let mut s = String::new();
482+
fn closure(a: &str, s: &mut String) {
483+
s.push_str(a)
484+
}
485+
closure("abc", &mut s);
486+
}
487+
```
488+
489+
463490
[discrete]
464491
=== `convert_for_loop_with_for_each`
465492
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_iter_for_each_to_for.rs#L76[convert_iter_for_each_to_for.rs]
@@ -1029,6 +1056,33 @@ fn qux(bar: Bar, baz: Baz) {}
10291056
```
10301057

10311058

1059+
[discrete]
1060+
=== `explicit_enum_discriminant`
1061+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/explicit_enum_discriminant.rs#L11[explicit_enum_discriminant.rs]
1062+
1063+
Adds explicit discriminant to all enum variants.
1064+
1065+
.Before
1066+
```rust
1067+
enum TheEnum┃ {
1068+
Foo,
1069+
Bar,
1070+
Baz = 42,
1071+
Quux,
1072+
}
1073+
```
1074+
1075+
.After
1076+
```rust
1077+
enum TheEnum {
1078+
Foo = 0,
1079+
Bar = 1,
1080+
Baz = 42,
1081+
Quux = 43,
1082+
}
1083+
```
1084+
1085+
10321086
[discrete]
10331087
=== `extract_expressions_from_format_string`
10341088
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs#L14[extract_expressions_from_format_string.rs]
@@ -1173,7 +1227,7 @@ fn main() {
11731227
.After
11741228
```rust
11751229
fn main() {
1176-
let ┃var_name = (1 + 2);
1230+
let ┃var_name = 1 + 2;
11771231
var_name * 4;
11781232
}
11791233
```
@@ -1254,7 +1308,7 @@ fn main() {
12541308

12551309
[discrete]
12561310
=== `flip_comma`
1257-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/flip_comma.rs#L5[flip_comma.rs]
1311+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/flip_comma.rs#L9[flip_comma.rs]
12581312

12591313
Flips two comma-separated items.
12601314

@@ -1849,7 +1903,7 @@ impl Person {
18491903

18501904
[discrete]
18511905
=== `generate_impl`
1852-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L8[generate_impl.rs]
1906+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L20[generate_impl.rs]
18531907

18541908
Adds a new inherent impl for a type.
18551909

@@ -2061,7 +2115,7 @@ impl<const N: usize> ${0:NewTrait}<N> for Foo<N> {
20612115

20622116
[discrete]
20632117
=== `generate_trait_impl`
2064-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L59[generate_impl.rs]
2118+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L66[generate_impl.rs]
20652119

20662120
Adds a new trait impl for a type.
20672121

@@ -3581,6 +3635,31 @@ fn arithmetics {
35813635
```
35823636

35833637

3638+
[discrete]
3639+
=== `toggle_macro_delimiter`
3640+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/toggle_macro_delimiter.rs#L9[toggle_macro_delimiter.rs]
3641+
3642+
Change macro delimiters in the order of `( -> { -> [ -> (`.
3643+
3644+
.Before
3645+
```rust
3646+
macro_rules! sth {
3647+
() => {};
3648+
}
3649+
3650+
sth!┃( );
3651+
```
3652+
3653+
.After
3654+
```rust
3655+
macro_rules! sth {
3656+
() => {};
3657+
}
3658+
3659+
sth!{ }
3660+
```
3661+
3662+
35843663
[discrete]
35853664
=== `unmerge_match_arm`
35863665
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unmerge_match_arm.rs#L10[unmerge_match_arm.rs]

generated_config.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ Whether to add parenthesis and argument snippets when completing function.
283283
--
284284
Whether to show full function/method signatures in completion docs.
285285
--
286+
[[rust-analyzer.completion.hideDeprecated]]rust-analyzer.completion.hideDeprecated (default: `false`)::
287+
+
288+
--
289+
Whether to omit deprecated items from autocompletion. By default they are marked as deprecated but not hidden.
290+
--
286291
[[rust-analyzer.completion.limit]]rust-analyzer.completion.limit (default: `null`)::
287292
+
288293
--

generated_features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ image::https://user-images.githubusercontent.com/48062697/113020658-b5f98b80-917
343343

344344

345345
=== Inlay Hints
346-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L454[inlay_hints.rs]
346+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L39[inlay_hints.rs]
347347

348348
rust-analyzer shows additional information inline with the source code.
349349
Editors usually render this using read-only virtual text snippets interspersed with code.

thisweek/_posts/2021-05-31-changelog-79.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ https://github.com/sponsors/rust-analyzer[GitHub Sponsors].
1212

1313
== New Features
1414

15-
* pr:8955[] add support for standalone Rust files:
15+
* pr:8955[] add support for stand-alone Rust files:
1616
+
1717
image::https://user-images.githubusercontent.com/2690773/119277037-0b579380-bc26-11eb-8d77-20d46ab4916a.gif[]
1818
* pr:8988[], pr:8990[] support "Go to implementations" on trait functions and associated constants:

thisweek/_posts/2024-08-05-changelog-245.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Release: release:2024-08-05[] (`v0.3.2062`)
1313

1414
== Fixes
1515

16+
* pr:17736[] (first contribution) show `async` in trait method completions.
1617
* pr:17750[] don't require absolute paths in `linkedProjects`.
1718
* pr:17715[] let glob imports override other globs' visibility.
1819
* pr:17747[] fix inference for method calls with elided lifetimes.
1920
* pr:17755[] apply `IndexMut` obligations for non-assigning mutable usages.
2021
* pr:17741[] make `include!` work with raw string literals.
2122
* pr:17763[] insert a tail `Ok(())` in type mismatch quick fix.
22-
* pr:17736[] show `async` in trait method completions.
2323
* pr:17789[] insert a generic args for `impl Trait` during lowering.
2424
* pr:17742[] don't retry inlay hint and code lens requests.
2525

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
= Changelog #249
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:779d9eee2ea403da447278a7007c9627c8878856[] +
7+
Release: release:2024-09-02[] (`v0.3.2096`)
8+
9+
== New Features
10+
11+
* pr:17814[], pr:17999[] implement object-safety and add it to hover.
12+
* pr:17940[], pr:17941[] implement "Convert closure to function" assist.
13+
* pr:17757[] implement "Toggle macro delimiters" assist.
14+
* pr:17985[] implement "Add explicit enum discriminants" assist.
15+
* pr:18006[] add an option to hide deprecated items from completion.
16+
* pr:18010[] support function types in lifetime elision hints.
17+
18+
== Fixes
19+
20+
* pr:17972[] revert "pr:17936[] implement ``module_path!``".
21+
* pr:17994[] fix `TokenStream::to_string` implementation dropping quotation marks.
22+
* pr:17987[] fix resolution of shadowed built-in macros.
23+
* pr:17963[] show error lifetime arguments as `'_`.
24+
* pr:17737[] sprinkle some sugar on async `impl Trait` completions.
25+
* pr:17970[] fix "Unwrap block" for blocks with modifiers.
26+
* pr:17991[] don't add unnecessary reference in "Extract variable".
27+
* pr:17973[] expand proc macros in workspace, not package root.
28+
* pr:17993[] keep field attributes when converting between tuples and named structs.
29+
* pr:17982[] consider indentation in "Generate impl" and "Generate trait impl".
30+
* pr:18015[] handle attributes in "Flip comma".
31+
* pr:18003[] do not report missing unsafe on `addr_of!(EXTERN_OR_MUT_STATIC)`.
32+
* pr:18005[] don't suggest `for` loops in `impl T for A` in function bodies.
33+
* pr:17962[] update return type syntax to match compiler.
34+
* pr:17988[] fix incorrect symbol definitions in SCIP output.
35+
36+
== Internal Improvements
37+
38+
* pr:17975[], pr:18009[] (first contribution) do not assume `rustup` is installed in `xtask codegen`.
39+
* pr:18008[], pr:18012[] make inlay hint resolution more reliable.
40+
* pr:17945[] recategorize config classes.
41+
* pr:17967[] prepare for stand-alone MBE tests.
42+
* pr:17992[] avoid newlines in worspace fetch errors.
43+
* pr:18011[] add some doc-comments to `OpQueue`.
44+
* pr:17974[] drop Apache license appendices.

0 commit comments

Comments
 (0)