Skip to content

Commit e425320

Browse files
committed
Changelog #189
1 parent 29a4c33 commit e425320

File tree

5 files changed

+133
-22
lines changed

5 files changed

+133
-22
lines changed

generated_assists.adoc

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ fn bar(arg: &str, baz: Baz) ${0:-> _} {
15581558

15591559
[discrete]
15601560
=== `generate_getter`
1561-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter.rs#L13[generate_getter.rs]
1561+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L73[generate_getter_or_setter.rs]
15621562

15631563
Generate a getter method.
15641564

@@ -1585,7 +1585,7 @@ impl Person {
15851585

15861586
[discrete]
15871587
=== `generate_getter_mut`
1588-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter.rs#L53[generate_getter.rs]
1588+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L113[generate_getter_or_setter.rs]
15891589

15901590
Generate a mut getter method.
15911591

@@ -1698,7 +1698,7 @@ impl<T: Clone> Ctx<T> {
16981698

16991699
[discrete]
17001700
=== `generate_setter`
1701-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_setter.rs#L9[generate_setter.rs]
1701+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L13[generate_getter_or_setter.rs]
17021702

17031703
Generate a setter method.
17041704

@@ -1716,13 +1716,73 @@ struct Person {
17161716
}
17171717

17181718
impl Person {
1719-
fn set_name(&mut self, name: String) {
1719+
fn set_name(&mut self, name: String) {
17201720
self.name = name;
17211721
}
17221722
}
17231723
```
17241724

17251725

1726+
[discrete]
1727+
=== `generate_trait_from_impl`
1728+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_trait_from_impl.rs#L13[generate_trait_from_impl.rs]
1729+
1730+
Generate trait for an already defined inherent impl and convert impl to a trait impl.
1731+
1732+
.Before
1733+
```rust
1734+
struct Foo<const N: usize>([i32; N]);
1735+
1736+
macro_rules! const_maker {
1737+
($t:ty, $v:tt) => {
1738+
const CONST: $t = $v;
1739+
};
1740+
}
1741+
1742+
impl<const N: usize> Fo┃o<N> {
1743+
// Used as an associated constant.
1744+
const CONST_ASSOC: usize = N * 4;
1745+
1746+
fn create() -> Option<()> {
1747+
Some(())
1748+
}
1749+
1750+
const_maker! {i32, 7}
1751+
}
1752+
```
1753+
1754+
.After
1755+
```rust
1756+
struct Foo<const N: usize>([i32; N]);
1757+
1758+
macro_rules! const_maker {
1759+
($t:ty, $v:tt) => {
1760+
const CONST: $t = $v;
1761+
};
1762+
}
1763+
1764+
trait ${0:TraitName}<const N: usize> {
1765+
// Used as an associated constant.
1766+
const CONST_ASSOC: usize = N * 4;
1767+
1768+
fn create() -> Option<()>;
1769+
1770+
const_maker! {i32, 7}
1771+
}
1772+
1773+
impl<const N: usize> ${0:TraitName}<N> for Foo<N> {
1774+
// Used as an associated constant.
1775+
const CONST_ASSOC: usize = N * 4;
1776+
1777+
fn create() -> Option<()> {
1778+
Some(())
1779+
}
1780+
1781+
const_maker! {i32, 7}
1782+
}
1783+
```
1784+
1785+
17261786
[discrete]
17271787
=== `generate_trait_impl`
17281788
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L56[generate_impl.rs]

generated_diagnostic.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This diagnostic is shown for macro expansion errors.
4444

4545

4646
=== macro-error
47-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/macro_error.rs#L12[macro_error.rs]
47+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/macro_error.rs#L17[macro_error.rs]
4848

4949
This diagnostic is shown for macro expansion errors.
5050

@@ -217,6 +217,6 @@ enable support for procedural macros (see `rust-analyzer.procMacro.attributes.en
217217

218218

219219
=== unused-mut
220-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mutability_errors.rs#L43[mutability_errors.rs]
220+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mutability_errors.rs#L45[mutability_errors.rs]
221221

222222
This diagnostic is triggered when a mutable variable isn't actually mutated.

generated_features.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,18 @@ Only workspace crates are included, no crates.io dependencies or sysroot crates.
994994
image::https://user-images.githubusercontent.com/48062697/113065588-068bdb80-91b1-11eb-9a78-0b4ef1e972fb.gif[]
995995

996996

997+
=== View Memory Layout
998+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/view_memory_layout.rs#L83[view_memory_layout.rs]
999+
1000+
Displays the recursive memory layout of a datatype.
1001+
1002+
|===
1003+
| Editor | Action Name
1004+
1005+
| VS Code | **rust-analyzer: View Memory Layout**
1006+
|===
1007+
1008+
9971009
=== View Mir
9981010
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/view_mir.rs#L6[view_mir.rs]
9991011

manual.adoc

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,8 @@ You can install the latest release of the plugin from
6464
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer[the marketplace].
6565

6666
Note that the plugin may cause conflicts with the
67-
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust[official Rust plugin].
68-
It is recommended to disable the Rust plugin when using the rust-analyzer extension.
69-
70-
By default, the plugin will prompt you to download the matching version of the server as well:
71-
72-
image::https://user-images.githubusercontent.com/9021944/75067008-17502500-54ba-11ea-835a-f92aac50e866.png[]
73-
74-
[NOTE]
75-
====
76-
To disable this notification put the following to `settings.json`
77-
78-
[source,json]
79-
----
80-
{ "rust-analyzer.updates.askBeforeDownload": false }
81-
----
82-
====
67+
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust[previous official Rust plugin].
68+
The latter is no longer maintained and should be uninstalled.
8369

8470
The server binary is stored in the extension install directory, which starts with `rust-lang.rust-analyzer-` and is located under:
8571

@@ -141,6 +127,9 @@ If you're not using Code, you can compile and install only the LSP server:
141127
$ cargo xtask install --server
142128
----
143129

130+
Make sure that `.cargo/bin` is in `$PATH` and precedes paths where `rust-analyzer` may also be installed.
131+
Specifically, `rustup` includes a proxy called `rust-analyzer`, which can cause problems if you're planning to use a source build or even a downloaded binary.
132+
144133
=== rust-analyzer Language Server Binary
145134

146135
Other editors generally require the `rust-analyzer` binary to be in `$PATH`.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
= Changelog #189
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:ff15634831f4a3cdb8abf5690a9848a6fdf48432[] +
7+
Release: release:2023-07-10[] (`v0.3.1583`)
8+
9+
== New Features
10+
11+
* pr:15081[] (first contribution) add a memory layout viewer:
12+
+
13+
image::https://user-images.githubusercontent.com/308347/252252339-e394e713-ebb9-4567-9acc-60f4a2a19407.png["Screenshot showing a memory layout view for a struct with `i32`, `u8`, `Vec<bool>` and `usize` fields."]
14+
* pr:15152[] add `Generate trait from impl` assist:
15+
+
16+
image::https://user-images.githubusercontent.com/20956650/249216814-05d4dda5-604a-4108-8b82-9b60bd45894a.gif["Screen recording showing the assist generating a trait from an `impl` block"]
17+
* pr:14990[] map our diagnostics to the `rustc` and `clippy` ones.
18+
* pr:15186[] don't add panics to error jump list by default.
19+
20+
== Fixes
21+
22+
* pr:15118[] (first contribution) follow raw pointers in autoderef chain when resolving methods with custom receiver.
23+
* pr:15235[] (first contribution) don't insert semicolon when extracting `match` arm.
24+
* pr:15226[] make `Expand glob import` work on enum imports.
25+
* pr:15211[] support GATs in bounds for associated types.
26+
* pr:15223[] don't show `unresolved-field` diagnostic for missing names.
27+
* pr:15216[] don't mark braces around `self` imports as unnecessary.
28+
* pr:15212[] recover from missing associated items and generic const defaults.
29+
* pr:15245[] fix missing terminator in pattern matching of consts.
30+
* pr:15222[] fix `size_of_val` and support `min_align_of_val` intrinsic.
31+
* pr:15244[] support `read_via_copy` intrinsic.
32+
* pr:15228[] implement recursion in MIR interpreter without recursion.
33+
* pr:15230[] use `Debug` impl for const eval result rendering.
34+
* pr:15227[] indent after pressing enter on a blank line.
35+
36+
== Internal Improvements
37+
38+
* pr:15202[] don't diagnose built-in derives.
39+
* pr:15204[] add analysis-stats flag to trigger some IDE features.
40+
* pr:15149[] speed up line index calculation via SSE2.
41+
* pr:15219[] unify Generate getter and setter assists.
42+
* pr:15205[] split out project loading capabilities from the `rust-analyzer` crate.
43+
* pr:15203[] shuffle some `proc_macro_expand` query things around.
44+
* pr:15209[] use stronger typing for `AstId` and `AstIdMap`.
45+
* pr:15181[] clean up `ImportMap`.
46+
* pr:15210[] remove `CfgExpander`.
47+
* pr:15206[] format `let`-`else`.
48+
* pr:15224[] replace `x` with `it`.
49+
* pr:15160[] enable `noUncheckedIndexedAccess` and `noPropertyAccessFromIndexSignature` TypeScript options.
50+
* pr:15234[] remind user to check `PATH` after installation.

0 commit comments

Comments
 (0)