Skip to content

Commit 8e45ca2

Browse files
committed
Changelog #202
1 parent e0b0987 commit 8e45ca2

File tree

3 files changed

+64
-4
lines changed

3 files changed

+64
-4
lines changed

generated_assists.adoc

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fn main() {
268268

269269
[discrete]
270270
=== `apply_demorgan`
271-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L11[apply_demorgan.rs]
271+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L17[apply_demorgan.rs]
272272

273273
Apply https://en.wikipedia.org/wiki/De_Morgan%27s_laws[De Morgan's law].
274274
This transforms expressions of the form `!l || !r` into `!(l && r)`.
@@ -290,6 +290,38 @@ fn main() {
290290
```
291291

292292

293+
[discrete]
294+
=== `apply_demorgan_iterator`
295+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L153[apply_demorgan.rs]
296+
297+
Apply https://en.wikipedia.org/wiki/De_Morgan%27s_laws[De Morgan's law] to
298+
`Iterator::all` and `Iterator::any`.
299+
300+
This transforms expressions of the form `!iter.any(|x| predicate(x))` into
301+
`iter.all(|x| !predicate(x))` and vice versa. This also works the other way for
302+
`Iterator::all` into `Iterator::any`.
303+
304+
.Before
305+
```rust
306+
fn main() {
307+
let arr = [1, 2, 3];
308+
if !arr.into_iter().┃any(|num| num == 4) {
309+
println!("foo");
310+
}
311+
}
312+
```
313+
314+
.After
315+
```rust
316+
fn main() {
317+
let arr = [1, 2, 3];
318+
if arr.into_iter().all(|num| num != 4) {
319+
println!("foo");
320+
}
321+
}
322+
```
323+
324+
293325
[discrete]
294326
=== `auto_import`
295327
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/auto_import.rs#L71[auto_import.rs]

generated_diagnostic.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This diagnostic is shown when the derive attribute has invalid input.
5656

5757

5858
=== mismatched-arg-count
59-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs#L35[mismatched_arg_count.rs]
59+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs#L30[mismatched_arg_count.rs]
6060

6161
This diagnostic is triggered if a function is invoked with an incorrect amount of arguments.
6262

@@ -112,7 +112,7 @@ This diagnostic is triggered if created structure does not have field provided i
112112

113113

114114
=== private-assoc-item
115-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/private_assoc_item.rs#L5[private_assoc_item.rs]
115+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/private_assoc_item.rs#L3[private_assoc_item.rs]
116116

117117
This diagnostic is triggered if the referenced associated item is not visible from the current
118118
module.
@@ -131,7 +131,7 @@ This diagnostic is triggered when `.filter_map(..).next()` is used, rather than
131131

132132

133133
=== type-mismatch
134-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/type_mismatch.rs#L12[type_mismatch.rs]
134+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/type_mismatch.rs#L11[type_mismatch.rs]
135135

136136
This diagnostic is triggered when the type of an expression or pattern does not match
137137
the expected type.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
= Changelog #202
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:b1f89a84ab350091e6c20cfe30c2fab8d76b80e4[] +
7+
Release: release:2023-10-09[] (`v0.3.1689`)
8+
9+
== New Features
10+
11+
* pr:15668[] (first contribution) add backtick to surrounding and auto-closing pairs.
12+
* pr:15700[] add assist for applying De Morgan's law to `Iterator::all` and `Iterator::any`:
13+
+
14+
video::https://user-images.githubusercontent.com/52933714/271883841-aad1a299-6620-432b-9106-aafd2a7fa9f5.webm[options=loop]
15+
* pr:15707[] allow configuring the status bar click action in VS Code.
16+
17+
== Fixes
18+
19+
* pr:15690[] (first contribution) fix line and column regex in the VS Code problem matcher.
20+
* pr:15701[] strip base prefix in `layout_scalar_valid_range`.
21+
* pr:15698[] allow more kinds of `if-let` patterns in guarded return assist.
22+
* pr:15709[] recognize `#[export_name = "main"]` function as binary entrypoint for runnables.
23+
* pr:15641[] fix path syntax produced by the `into_to_qualified_from` assist.
24+
* pr:15600[] ensure `rustfmt` runs when configured with `./`.
25+
26+
== Internal Improvements
27+
28+
* pr:15721[] shrink `PatPtr` by swapping its `AstPtr` and `Either` wrap order.

0 commit comments

Comments
 (0)