Skip to content

Commit 44132bf

Browse files
committed
Changelog #151
1 parent 8761cde commit 44132bf

File tree

4 files changed

+113
-3
lines changed

4 files changed

+113
-3
lines changed

generated_assists.adoc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,52 @@ fn main() {
477477
```
478478

479479

480+
[discrete]
481+
=== `convert_named_struct_to_tuple_struct`
482+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_named_struct_to_tuple_struct.rs#L11[convert_named_struct_to_tuple_struct.rs]
483+
484+
Converts struct with named fields to tuple struct, and analogously for enum variants with named
485+
fields.
486+
487+
.Before
488+
```rust
489+
struct Point┃ { x: f32, y: f32 }
490+
491+
impl Point {
492+
pub fn new(x: f32, y: f32) -> Self {
493+
Point { x, y }
494+
}
495+
496+
pub fn x(&self) -> f32 {
497+
self.x
498+
}
499+
500+
pub fn y(&self) -> f32 {
501+
self.y
502+
}
503+
}
504+
```
505+
506+
.After
507+
```rust
508+
struct Point(f32, f32);
509+
510+
impl Point {
511+
pub fn new(x: f32, y: f32) -> Self {
512+
Point(x, y)
513+
}
514+
515+
pub fn x(&self) -> f32 {
516+
self.0
517+
}
518+
519+
pub fn y(&self) -> f32 {
520+
self.1
521+
}
522+
}
523+
```
524+
525+
480526
[discrete]
481527
=== `convert_to_guarded_return`
482528
**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]

generated_diagnostic.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ This diagnostic is shown for code with inactive `#[cfg]` attributes.
1818
This diagnostic is triggered if an item name doesn't follow https://doc.rust-lang.org/1.0.0/style/style/naming/README.html[Rust naming convention].
1919

2020

21+
=== incorrect-try-target
22+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/incorrect_try_expr.rs#L5[incorrect_try_expr.rs]
23+
24+
This diagnostic is triggered if a question mark operator was used in a context where it is not applicable.
25+
26+
2127
=== invalid-derive-target
2228
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/invalid_derive_target.rs#L3[invalid_derive_target.rs]
2329

@@ -75,6 +81,12 @@ This diagnostic is triggered if an operation marked as `unsafe` is used outside
7581
This diagnostic is triggered if created structure does not have field provided in record.
7682

7783

84+
=== not-implemented
85+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/not_implemented.rs#L5[not_implemented.rs]
86+
87+
This diagnostic is triggered if a type doesn't implement a necessary trait.
88+
89+
7890
=== replace-filter-map-next-with-find-map
7991
**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]
8092

manual.adoc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,25 @@ On Unix, running the editor from a shell or changing the `.desktop` file to set
174174

175175
==== `rustup`
176176

177-
`rust-analyzer` is available in `rustup`, but only in the nightly toolchain:
177+
`rust-analyzer` is available in `rustup`:
178178

179179
[source,bash]
180180
----
181-
$ rustup +nightly component add rust-analyzer-preview
181+
$ rustup component add rust-analyzer
182182
----
183183

184-
However, in contrast to `component add clippy` or `component add rustfmt`, this does not actually place a `rust-analyzer` binary in `~/.cargo/bin`, see https://github.com/rust-lang/rustup/issues/2411[this issue].
184+
However, in contrast to `component add clippy` or `component add rustfmt`, this does not actually place a `rust-analyzer` binary in `~/.cargo/bin`, see https://github.com/rust-lang/rustup/issues/2411[this issue]. You can find the path to the binary using:
185+
[source,bash]
186+
----
187+
$ rustup which --toolchain stable rust-analyzer
188+
----
189+
You can link to there from `~/.cargo/bin` or configure your editor to use the full path.
190+
191+
Alternatively you might be able to configure your editor to start `rust-analyzer` using the command:
192+
[source,bash]
193+
----
194+
$ rustup run stable rust-analyzer
195+
----
185196

186197
==== Arch Linux
187198

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
= Changelog #151
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:0531aab522f25d6aae30b2cc23a09f4b9257eedc[] +
6+
Release: release:2022-10-17[]
7+
8+
== New Features
9+
10+
* pr:13358[] (first contribution) complete Cargo environment variables in `env!` and `option_env!`:
11+
+
12+
video::https://user-images.githubusercontent.com/308347/196144995-64e38e3c-0ad7-4cf3-b0f7-4243866ed341.mp4[options=loop]
13+
* pr:13303[] add `Convert named to tuple struct` assist:
14+
+
15+
video::https://user-images.githubusercontent.com/308347/196149918-7a27df57-b525-40cf-ae12-bc58e077d637.mp4[options=loop]
16+
* pr:13354[] diagnose some incorrect usages of the question mark operator:
17+
+
18+
video::https://user-images.githubusercontent.com/308347/196147506-111000e4-60a9-4dd2-8f0b-252d766b3cb5.mp4[options=loop]
19+
20+
== Fixes
21+
22+
* pr:13420[] (first contribution) don't trigger auto-import assist on parameter names.
23+
* pr:13391[] (first contribution) update installation instructions for the stable `rustup` component.
24+
* pr:13380[] honor `cfg` attributes on params when lowering patterns.
25+
* pr:13384[] expand unmatched macro-by-example fragments to reasonable default token trees.
26+
* pr:13382[] reorder `dyn` bounds on render.
27+
* pr:13392[] prefer similar tokens when expanding macros speculatively.
28+
* pr:13333[] fix placement of and indentation inside generated methods.
29+
* pr:13377[] underline only intra-doc links instead of the whole doc comment.
30+
* pr:13402[] cast `runnableEnv` items to string.
31+
32+
== Internal Improvements
33+
34+
* pr:13397[] (first contribution) fix links in `syntax.md`.
35+
* pr:13376[] add `GenericParamList::to_generic_args` and `{TypeParam,ConstParam}::remove_default` APIs.
36+
* pr:13385[] don't report build scripts and proc macros as metadata progress.
37+
* pr:13386[] refactor completion expansion.
38+
* pr:13357[] allow `minicore` flags specifications to be order independent.
39+
* pr:13401[] run `analysis-stats` on CI, with `opt-level = 1`.
40+
* pr:13415[] set a timeout when publishing to OVSX.
41+
* pr:13408[] bump `chalk`.

0 commit comments

Comments
 (0)