Skip to content

Commit 078bb75

Browse files
committed
Changelog #264
1 parent 552c5a9 commit 078bb75

File tree

6 files changed

+96
-11
lines changed

6 files changed

+96
-11
lines changed

generated_assists.adoc

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,28 @@ enum TheEnum {
10831083
```
10841084

10851085

1086+
[discrete]
1087+
=== `extract_constant`
1088+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L31[extract_variable.rs]
1089+
1090+
Extracts subexpression into a constant.
1091+
1092+
.Before
1093+
```rust
1094+
fn main() {
1095+
┃(1 + 2)┃ * 4;
1096+
}
1097+
```
1098+
1099+
.After
1100+
```rust
1101+
fn main() {
1102+
const ┃VAR_NAME: i32 = 1 + 2;
1103+
VAR_NAME * 4;
1104+
}
1105+
```
1106+
1107+
10861108
[discrete]
10871109
=== `extract_expressions_from_format_string`
10881110
**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]
@@ -1106,7 +1128,7 @@ fn main() {
11061128

11071129
[discrete]
11081130
=== `extract_function`
1109-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L37[extract_function.rs]
1131+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L39[extract_function.rs]
11101132

11111133
Extracts selected statements and comments into new function.
11121134

@@ -1169,6 +1191,28 @@ fn bar(name: i32) -> i32 {
11691191
```
11701192

11711193

1194+
[discrete]
1195+
=== `extract_static`
1196+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L48[extract_variable.rs]
1197+
1198+
Extracts subexpression into a static.
1199+
1200+
.Before
1201+
```rust
1202+
fn main() {
1203+
┃(1 + 2)┃ * 4;
1204+
}
1205+
```
1206+
1207+
.After
1208+
```rust
1209+
fn main() {
1210+
static ┃VAR_NAME: i32 = 1 + 2;
1211+
VAR_NAME * 4;
1212+
}
1213+
```
1214+
1215+
11721216
[discrete]
11731217
=== `extract_struct_from_enum_variant`
11741218
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs#L26[extract_struct_from_enum_variant.rs]
@@ -1213,7 +1257,7 @@ struct S {
12131257

12141258
[discrete]
12151259
=== `extract_variable`
1216-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L16[extract_variable.rs]
1260+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L14[extract_variable.rs]
12171261

12181262
Extracts subexpression into a variable.
12191263

@@ -1618,7 +1662,7 @@ pub fn add(a: i32, b: i32) -> i32 { a + b }
16181662
/// # Examples
16191663
///
16201664
/// ```
1621-
/// use test::add;
1665+
/// use ra_test_fixture::add;
16221666
///
16231667
/// assert_eq!(add(a, b), );
16241668
/// ```
@@ -2202,7 +2246,7 @@ fn foo(name: Option<&str>) {
22022246

22032247
[discrete]
22042248
=== `inline_const_as_literal`
2205-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_const_as_literal.rs#L5[inline_const_as_literal.rs]
2249+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_const_as_literal.rs#L6[inline_const_as_literal.rs]
22062250

22072251
Evaluate and inline const variable as literal.
22082252

@@ -2818,7 +2862,7 @@ use std::{fmt::Formatter, io};
28182862

28192863
[discrete]
28202864
=== `promote_local_to_const`
2821-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/promote_local_to_const.rs#L19[promote_local_to_const.rs]
2865+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/promote_local_to_const.rs#L17[promote_local_to_const.rs]
28222866

28232867
Promotes a local variable to a const item changing its name to a `SCREAMING_SNAKE_CASE` variant
28242868
if the local uses no non-const expressions.

generated_config.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ Show full signature of the callable. Only shows parameters if disabled.
992992
--
993993
Show documentation.
994994
--
995-
[[rust-analyzer.typing.excludeChars]]rust-analyzer.typing.excludeChars (default: `"<"`)::
995+
[[rust-analyzer.typing.excludeChars]]rust-analyzer.typing.excludeChars (default: `"|<"`)::
996996
+
997997
--
998998
Specify the characters to exclude from triggering typing assists. The default trigger characters are `.`, `=`, `<`, `>`, `{`, and `(`.

generated_diagnostic.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Diagnoses redundant trait items in a trait impl.
213213

214214

215215
=== type-mismatch
216-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/type_mismatch.rs#L16[type_mismatch.rs]
216+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/type_mismatch.rs#L20[type_mismatch.rs]
217217

218218
This diagnostic is triggered when the type of an expression or pattern does not match
219219
the expected type.

generated_features.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Displays the ItemTree of the currently open file, for debugging.
176176

177177

178178
=== Expand Macro Recursively
179-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/expand_macro.rs#L17[expand_macro.rs]
179+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/expand_macro.rs#L18[expand_macro.rs]
180180

181181
Shows the full macro expansion of the macro at the current caret position.
182182

@@ -383,7 +383,7 @@ image::https://user-images.githubusercontent.com/48062697/113020660-b5f98b80-917
383383

384384

385385
=== Interpret A Function, Static Or Const.
386-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/interpret.rs#L7[interpret.rs]
386+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/interpret.rs#L8[interpret.rs]
387387

388388
|===
389389
| Editor | Action Name
@@ -411,7 +411,7 @@ image::https://user-images.githubusercontent.com/48062697/113020661-b6922200-917
411411

412412

413413
=== Magic Completions
414-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/lib.rs#L80[lib.rs]
414+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/lib.rs#L81[lib.rs]
415415

416416
In addition to usual reference completion, rust-analyzer provides some ✨magic✨
417417
completions as well:

manual.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ Unfortunately, it downloads an old version of `rust-analyzer`, but you can set t
580580

581581
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.
582582

583-
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
583+
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/autopublish.yaml[the publish workflow].
584584

585585
=== Zed
586586

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
= Changelog #264
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:27e824fad4cb40f9e475757871e7d259d73f20da[] +
7+
Release: release:2024-12-16[] (`v0.3.2220`)
8+
9+
== New Features
10+
11+
* pr:18670[] drop proc macro server support for 1.66 and older toolchains.
12+
* pr:18458[] add diagnostic fix to remove unnecessary `Some` or `Ok` wrapper on type mismatch.
13+
* pr:18652[] add "Extract into constant" assist.
14+
15+
== Fixes
16+
17+
* pr:18667[] (first contribution) fix "Replace #[derive()]` when snippet text edits are disabled.
18+
* pr:18653[] hash completion items to properly match them when resolved.
19+
* pr:18645[] allow uninhabited non-exhaustive structs.
20+
* pr:18663[] swallow `rustfmt` parsing panics.
21+
* pr:18660[] clean up copied proc macro libraries on exit.
22+
* pr:18675[] fix panic when displaying generic params with defaults, again.
23+
* pr:18684[] re-enable snippet text edits capability.
24+
* pr:18656[] preserve order of parameters in "Extract function".
25+
* pr:18674[] show expansion errors in "Expand macro at caret".
26+
* pr:18466[] properly handle different defaults for severity of lints.
27+
* pr:18668[] fix source root construction for virtual manifests.
28+
29+
== Internal Improvements
30+
31+
* pr:18643[] rename test fixture crates to `ra_test_fixture`.
32+
* pr:18644[] remove `cfg-if` patching hack.
33+
* pr:18647[] disable pipe in typing handler.
34+
* pr:18657[] migrate `generate_enum_variant` assist to `SyntaxEditor`.
35+
* pr:18531[] map new replacement nodes to their mutable equivalents in `SyntaxEditor`.
36+
* pr:18669[] only parse the object file once in `proc-macro-srv`.
37+
* pr:18677[] implement `naked_asm!` built-in.
38+
* pr:18672[] simplify dummy `proc-macro-srv`.
39+
* pr:18694[] show MIR eval errors on hover when debug environment variable is set.
40+
* pr:18693[] fix proc-macro library names on Windows.
41+
* pr:18441[] try not cache the config directory path.

0 commit comments

Comments
 (0)