Skip to content

Commit 2f7c4b1

Browse files
committed
Changelog #206
1 parent 34c7225 commit 2f7c4b1

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

generated_assists.adoc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,45 @@ impl MyStruct {
17751775
```
17761776

17771777

1778+
[discrete]
1779+
=== `generate_mut_trait_impl`
1780+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs#L12[generate_mut_trait_impl.rs]
1781+
1782+
Adds a IndexMut impl from the `Index` trait.
1783+
1784+
.Before
1785+
```rust
1786+
pub enum Axis { X = 0, Y = 1, Z = 2 }
1787+
1788+
impl<T> core::ops::Index┃<Axis> for [T; 3] {
1789+
type Output = T;
1790+
1791+
fn index(&self, index: Axis) -> &Self::Output {
1792+
&self[index as usize]
1793+
}
1794+
}
1795+
```
1796+
1797+
.After
1798+
```rust
1799+
pub enum Axis { X = 0, Y = 1, Z = 2 }
1800+
1801+
┃impl<T> core::ops::IndexMut<Axis> for [T; 3] {
1802+
fn index_mut(&mut self, index: Axis) -> &mut Self::Output {
1803+
&self[index as usize]
1804+
}
1805+
}
1806+
1807+
impl<T> core::ops::Index<Axis> for [T; 3] {
1808+
type Output = T;
1809+
1810+
fn index(&self, index: Axis) -> &Self::Output {
1811+
&self[index as usize]
1812+
}
1813+
}
1814+
```
1815+
1816+
17781817
[discrete]
17791818
=== `generate_new`
17801819
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_new.rs#L13[generate_new.rs]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
= Changelog #206
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:c1c9e10f72ffd2e829d20ff1439ff49c2e121731[] +
7+
Release: release:2023-11-06[] (`v0.3.1722`)
8+
9+
== New Features
10+
11+
* pr:15819[] (first contribution) skip token tree limit for `include!` macro calls.
12+
* pr:15832[] add `generate_mut_trait_impl` assist:
13+
+
14+
image::https://user-images.githubusercontent.com/71162630/280443864-362a5a93-e109-4ffc-996e-9b6e4f54fcfa.gif["Screen recording showing the assist adding an `IndexMut` impl from an existing `Index` one"]
15+
16+
== Fixes
17+
18+
* pr:15827[] (first contribution) add `formatters` category to VSCode metadata.
19+
* pr:15788[] allow importing traits `as _`:
20+
+
21+
image::https://user-images.githubusercontent.com/71162630/277167845-81601160-fe55-46e3-ab8d-b2705e1aa696.gif["Screen recording showing both `import Foo` and `import Foo as _` being available in the quick fix menu"]
22+
* pr:15834[] fix docs path for derive macros.

0 commit comments

Comments
 (0)