Skip to content

Commit 2e17098

Browse files
committed
Changelog #220
1 parent aadfde8 commit 2e17098

File tree

5 files changed

+84
-18
lines changed

5 files changed

+84
-18
lines changed

generated_assists.adoc

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ fn main() {
693693

694694
[discrete]
695695
=== `convert_to_guarded_return`
696-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_to_guarded_return.rs#L21[convert_to_guarded_return.rs]
696+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_to_guarded_return.rs#L24[convert_to_guarded_return.rs]
697697

698698
Replace a large conditional with a guarded return.
699699

@@ -944,7 +944,7 @@ fn main() {
944944

945945
[discrete]
946946
=== `extract_function`
947-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L39[extract_function.rs]
947+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L37[extract_function.rs]
948948

949949
Extracts selected statements and comments into new function.
950950

@@ -977,7 +977,7 @@ fn ┃fun_name(n: i32) {
977977

978978
[discrete]
979979
=== `extract_module`
980-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_module.rs#L32[extract_module.rs]
980+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_module.rs#L30[extract_module.rs]
981981

982982
Extracts a selected region as separate module. All the references, visibility and imports are
983983
resolved.
@@ -1251,7 +1251,7 @@ impl Default for Example {
12511251

12521252
[discrete]
12531253
=== `generate_delegate_methods`
1254-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_methods.rs#L17[generate_delegate_methods.rs]
1254+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_methods.rs#L15[generate_delegate_methods.rs]
12551255

12561256
Generate delegate methods.
12571257

@@ -1681,15 +1681,15 @@ struct Person {
16811681

16821682
impl Person {
16831683
fn ┃name(&self) -> &str {
1684-
self.name.as_ref()
1684+
&self.name
16851685
}
16861686
}
16871687
```
16881688

16891689

16901690
[discrete]
16911691
=== `generate_getter_mut`
1692-
**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]
1692+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L127[generate_getter_or_setter.rs]
16931693

16941694
Generate a mut getter method.
16951695

@@ -1733,9 +1733,7 @@ struct Ctx<T: Clone> {
17331733
data: T,
17341734
}
17351735

1736-
impl<T: Clone> Ctx<T> {
1737-
1738-
}
1736+
impl<T: Clone> Ctx<T> {┃}
17391737
```
17401738

17411739

@@ -1816,7 +1814,7 @@ impl<T> core::ops::Index<Axis> for [T; 3] {
18161814

18171815
[discrete]
18181816
=== `generate_new`
1819-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_new.rs#L13[generate_new.rs]
1817+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_new.rs#L14[generate_new.rs]
18201818

18211819
Adds a `fn new` for a type.
18221820

@@ -1834,7 +1832,9 @@ struct Ctx<T: Clone> {
18341832
}
18351833

18361834
impl<T: Clone> Ctx<T> {
1837-
fn ┃new(data: T) -> Self { Self { data } }
1835+
fn ┃new(data: T) -> Self {
1836+
Self { data }
1837+
}
18381838
}
18391839
```
18401840

@@ -1928,7 +1928,7 @@ impl<const N: usize> ${0:TraitName}<N> for Foo<N> {
19281928

19291929
[discrete]
19301930
=== `generate_trait_impl`
1931-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L56[generate_impl.rs]
1931+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L59[generate_impl.rs]
19321932

19331933
Adds a new trait impl for a type.
19341934

@@ -1945,9 +1945,7 @@ struct Ctx<T: Clone> {
19451945
data: T,
19461946
}
19471947

1948-
impl<T: Clone> ┃ for Ctx<T> {
1949-
1950-
}
1948+
impl<T: Clone> ${0:_} for Ctx<T> {}
19511949
```
19521950

19531951

@@ -2348,7 +2346,7 @@ use std::{fmt::Formatter, io};
23482346

23492347
[discrete]
23502348
=== `merge_match_arms`
2351-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/merge_match_arms.rs#L11[merge_match_arms.rs]
2349+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/merge_match_arms.rs#L12[merge_match_arms.rs]
23522350

23532351
Merges the current match arm with the following if their bodies are identical.
23542352

@@ -3006,7 +3004,7 @@ fn main() {
30063004

30073005
[discrete]
30083006
=== `replace_derive_with_manual_impl`
3009-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs#L18[replace_derive_with_manual_impl.rs]
3007+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs#L20[replace_derive_with_manual_impl.rs]
30103008

30113009
Converts a `derive` impl into a manual one.
30123010

generated_config.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ Can be a single target, e.g. `"x86_64-unknown-linux-gnu"` or a list of targets,
251251

252252
Aliased as `"checkOnSave.targets"`.
253253
--
254+
[[rust-analyzer.check.workspace]]rust-analyzer.check.workspace (default: `true`)::
255+
+
256+
--
257+
Whether `--workspace` should be passed to `cargo check`.
258+
If false, `-p <package>` will be passed instead.
259+
--
254260
[[rust-analyzer.completion.autoimport.enable]]rust-analyzer.completion.autoimport.enable (default: `true`)::
255261
+
256262
--
@@ -745,6 +751,11 @@ Sets the LRU capacity of the specified queries.
745751
--
746752
Whether to show `can't find Cargo.toml` error message.
747753
--
754+
[[rust-analyzer.notifications.unindexedProject]]rust-analyzer.notifications.unindexedProject (default: `false`)::
755+
+
756+
--
757+
Whether to send an UnindexedProject notification to the client.
758+
--
748759
[[rust-analyzer.numThreads]]rust-analyzer.numThreads (default: `null`)::
749760
+
750761
--

generated_diagnostic.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ module.
124124
This diagnostic is triggered if the accessed field is not visible from the current module.
125125

126126

127+
=== remove-trailing-return
128+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/remove_trailing_return.rs#L8[remove_trailing_return.rs]
129+
130+
This diagnostic is triggered when there is a redundant `return` at the end of a function
131+
or closure.
132+
133+
134+
=== remove-unnecessary-else
135+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/remove_unnecessary_else.rs#L14[remove_unnecessary_else.rs]
136+
137+
This diagnostic is triggered when there is an `else` block for an `if` expression whose
138+
then branch diverges (e.g. ends with a `return`, `continue`, `break` e.t.c).
139+
140+
127141
=== replace-filter-map-next-with-find-map
128142
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/replace_filter_map_next_with_find_map.rs#L11[replace_filter_map_next_with_find_map.rs]
129143

generated_features.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ image::https://user-images.githubusercontent.com/48062697/113020654-b42fc800-917
223223

224224

225225
=== Find All References
226-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/references.rs#L44[references.rs]
226+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/references.rs#L42[references.rs]
227227

228228
Shows all references of the item at the cursor location
229229

@@ -414,6 +414,7 @@ There are postfix completions, which can be triggered by typing something like
414414
- `expr.ref` -> `&expr`
415415
- `expr.refm` -> `&mut expr`
416416
- `expr.let` -> `let $0 = expr;`
417+
- `expr.lete` -> `let $1 = expr else { $0 };`
417418
- `expr.letm` -> `let mut $0 = expr;`
418419
- `expr.not` -> `!expr`
419420
- `expr.dbg` -> `dbg!(expr)`
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
= Changelog #220
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:c06ca6cff5af0fce63d4a28b33e5d244686cb442[] +
7+
Release: release:2024-02-12[] (`v0.3.1839`)
8+
9+
== New Features
10+
11+
* pr:16510[] add option to only run `cargo check` on the current package.
12+
* pr:16502[] add unnecessary else diagnostic.
13+
* pr:16460[] add trailing return diagnostic.
14+
* pr:16477[] add incorrect case diagnostics for traits and their associated items.
15+
* pr:16454[] add `break` and `return` postfix completions.
16+
* pr:16424[] add support for converting `let` statements to guarded returns.
17+
* pr:15863[] add `UnindexedProject` notification for LSP clients.
18+
19+
== Fixes
20+
21+
* pr:16487[] (first contribution) improve `Deref` handling in "Generate getter" assist.
22+
* pr:16509[] render visibility for tuple struct fields.
23+
* pr:16124[] improve parser error recovery on missing arguments in call expressions.
24+
* pr:16484[] preserve `where` clause when expanding built-in derive macros.
25+
* pr:16462[] improve error message when proc-macros have not yet been built.
26+
* pr:16497[] fix spacing when inlining functions defined in macros.
27+
* pr:16517[] fix crash inside `filter_unnecessary_bounds` on missing generic parameter.
28+
29+
== Internal Improvements
30+
31+
* pr:16482[] (first contribution) use boxed slice for `Subtree::token_trees`.
32+
* pr:16503[] move `salsa` fork in-tree.
33+
* pr:16505[] optimize input queries that take no arguments.
34+
* pr:16527[] remove hack for self-referential ``SyntaxContext``s.
35+
* pr:16467[] migrate assists to the structured snippet API, part 6.
36+
* pr:16474[] instrument more paths using `tracing`.
37+
* pr:16499[] bump `rustc_pattern_analysis`.
38+
* pr:16525[] abstract more over `ItemTreeLoc`-like structs.
39+
* pr:16470[] lint against debug prints and disallowed types using Clippy.
40+
* pr:16500[] run Clippy on Windows, not Linux.
41+
* pr:16518[], pr:16519[], pr:16521[] enable more Clippy lints.
42+
* pr:16492[], pr:16532[] sync from downstream.

0 commit comments

Comments
 (0)