Skip to content

Commit

Permalink
Changelog #206
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola committed Nov 6, 2023
1 parent 34c7225 commit 2f7c4b1
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
39 changes: 39 additions & 0 deletions generated_assists.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,45 @@ impl MyStruct {
```


[discrete]
=== `generate_mut_trait_impl`
**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]

Adds a IndexMut impl from the `Index` trait.

.Before
```rust
pub enum Axis { X = 0, Y = 1, Z = 2 }

impl<T> core::ops::Index┃<Axis> for [T; 3] {
type Output = T;

fn index(&self, index: Axis) -> &Self::Output {
&self[index as usize]
}
}
```

.After
```rust
pub enum Axis { X = 0, Y = 1, Z = 2 }

┃impl<T> core::ops::IndexMut<Axis> for [T; 3] {
fn index_mut(&mut self, index: Axis) -> &mut Self::Output {
&self[index as usize]
}
}

impl<T> core::ops::Index<Axis> for [T; 3] {
type Output = T;

fn index(&self, index: Axis) -> &Self::Output {
&self[index as usize]
}
}
```


[discrete]
=== `generate_new`
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_new.rs#L13[generate_new.rs]
Expand Down
22 changes: 22 additions & 0 deletions thisweek/_posts/2023-11-06-changelog-206.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
= Changelog #206
:sectanchors:
:experimental:
:page-layout: post

Commit: commit:c1c9e10f72ffd2e829d20ff1439ff49c2e121731[] +
Release: release:2023-11-06[] (`v0.3.1722`)

== New Features

* pr:15819[] (first contribution) skip token tree limit for `include!` macro calls.
* pr:15832[] add `generate_mut_trait_impl` assist:
+
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"]

== Fixes

* pr:15827[] (first contribution) add `formatters` category to VSCode metadata.
* pr:15788[] allow importing traits `as _`:
+
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"]
* pr:15834[] fix docs path for derive macros.

0 comments on commit 2f7c4b1

Please sign in to comment.