Skip to content

Commit 9461775

Browse files
committed
Changelog #203
1 parent 8e45ca2 commit 9461775

File tree

5 files changed

+111
-3
lines changed

5 files changed

+111
-3
lines changed

generated_assists.adoc

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,38 @@ fn main() {
719719
```
720720

721721

722+
[discrete]
723+
=== `convert_tuple_return_type_to_struct`
724+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_tuple_return_type_to_struct.rs#L20[convert_tuple_return_type_to_struct.rs]
725+
726+
This converts the return type of a function from a tuple type
727+
into a tuple struct and updates the body accordingly.
728+
729+
.Before
730+
```rust
731+
fn bar() {
732+
let (a, b, c) = foo();
733+
}
734+
735+
fn foo() -> (┃u32, u32, u32) {
736+
(1, 2, 3)
737+
}
738+
```
739+
740+
.After
741+
```rust
742+
fn bar() {
743+
let FooResult(a, b, c) = foo();
744+
}
745+
746+
struct FooResult(u32, u32, u32);
747+
748+
fn foo() -> FooResult {
749+
FooResult(1, 2, 3)
750+
}
751+
```
752+
753+
722754
[discrete]
723755
=== `convert_tuple_struct_to_named_struct`
724756
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_tuple_struct_to_named_struct.rs#L10[convert_tuple_struct_to_named_struct.rs]
@@ -2951,6 +2983,29 @@ fn handle(action: Action) {
29512983
```
29522984

29532985

2986+
[discrete]
2987+
=== `replace_is_some_with_if_let_some`
2988+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs#L5[replace_is_method_with_if_let_method.rs]
2989+
2990+
Replace `if x.is_some()` with `if let Some(_tmp) = x` or `if x.is_ok()` with `if let Ok(_tmp) = x`.
2991+
2992+
.Before
2993+
```rust
2994+
fn main() {
2995+
let x = Some(1);
2996+
if x.is_som┃e() {}
2997+
}
2998+
```
2999+
3000+
.After
3001+
```rust
3002+
fn main() {
3003+
let x = Some(1);
3004+
if let Some(${0:_tmp}) = x {}
3005+
}
3006+
```
3007+
3008+
29543009
[discrete]
29553010
=== `replace_let_with_if_let`
29563011
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_let_with_if_let.rs#L15[replace_let_with_if_let.rs]

generated_config.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,16 @@ Command to be executed instead of 'cargo' for runnables.
757757
Additional arguments to be passed to cargo for runnables such as
758758
tests or binaries. For example, it may be `--release`.
759759
--
760+
[[rust-analyzer.rust.analyzerTargetDir]]rust-analyzer.rust.analyzerTargetDir (default: `null`)::
761+
+
762+
--
763+
Optional path to a rust-analyzer specific target directory.
764+
This prevents rust-analyzer's `cargo check` from locking the `Cargo.lock`
765+
at the expense of duplicating build artifacts.
766+
767+
Set to `true` to use a subdirectory of the existing target directory or
768+
set to a path relative to the workspace to use that path.
769+
--
760770
[[rust-analyzer.rustc.source]]rust-analyzer.rustc.source (default: `null`)::
761771
+
762772
--

generated_features.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ image::https://user-images.githubusercontent.com/48062697/113020673-b85be580-917
6868

6969

7070
=== Completion With Autoimport
71-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/completions/flyimport.rs#L20[flyimport.rs]
71+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/completions/flyimport.rs#L19[flyimport.rs]
7272

7373
When completing names in the current scope, proposes additional imports from other modules or crates,
7474
if they can be qualified in the scope, and their name contains all symbols from the completion input.
@@ -993,7 +993,7 @@ image::https://user-images.githubusercontent.com/48062697/113065588-068bdb80-91b
993993

994994

995995
=== View Memory Layout
996-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/view_memory_layout.rs#L83[view_memory_layout.rs]
996+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/view_memory_layout.rs#L77[view_memory_layout.rs]
997997

998998
Displays the recursive memory layout of a datatype.
999999

@@ -1015,7 +1015,7 @@ Displays the recursive memory layout of a datatype.
10151015

10161016

10171017
=== Workspace Symbol
1018-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-db/src/symbol_index.rs#L166[symbol_index.rs]
1018+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-db/src/symbol_index.rs#L181[symbol_index.rs]
10191019

10201020
Uses fuzzy-search to find types, modules and functions by name across your
10211021
project and dependencies. This is **the** most useful feature, which improves code

manual.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ There is a package named `ra_ap_rust_analyzer` available on https://crates.io/cr
555555

556556
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
557557

558+
=== Zed
559+
560+
https://zed.dev[Zed] has native `rust-analyzer` support.
561+
If the LSP binary is not available, Zed can install it when opening a Rust file.
562+
558563
== Troubleshooting
559564

560565
Start with looking at the rust-analyzer version.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
= Changelog #203
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:6572ec8d94c83f8cc6afe0069269abeddc37c25e[] +
7+
Release: release:2023-10-16[] (`v0.3.1697`)
8+
9+
== New Features
10+
11+
* pr:15728[] (first contribution) VS Code: support opening local documentation if available:
12+
+
13+
video::https://user-images.githubusercontent.com/9659253/273422126-715b84dd-4f14-4ba0-a904-749b847eb3d5.webm[options=loop]
14+
* pr:15743[], pr:15752[], pr:15755[] (first contribution) add assist to convert `is_some` / `is_ok` and to `if let`:
15+
+
16+
image::https://user-images.githubusercontent.com/71162630/275121299-a7866efe-2d54-488b-903e-9df039f34a7e.gif["Screen recording showing an assist that rewrites `if a.is_some()` to `if let Some(_tmp) = a`, and similarly for `is_ok`]
17+
* pr:15681[] (first contribution) add `rust-analyzer.rust.analyzerTargetDir` option to use `rust-analyzer` specific target directory.
18+
* pr:15696[] add tuple return to tuple struct assist:
19+
+
20+
video::https://user-images.githubusercontent.com/52933714/271883958-2803ff58-fde3-4144-9495-7c7c7e139075.webm[options=loop]
21+
22+
== Fixes
23+
24+
* pr:15744[] (first contribution) add diagnostics for char and byte literal errors:
25+
+
26+
image::https://user-images.githubusercontent.com/308347/275412431-12ddaf06-1d10-4e77-b566-ba8a1b9aff0d.png["Screenshot showing errros on invalid char and byte literal"]
27+
* pr:15713[] offer prefix match flyimport completions for one and two character paths:
28+
+
29+
image::https://user-images.githubusercontent.com/308347/275410445-6db5ecf5-8ba2-47fb-82fb-508176a5207a.png["Screenshot showing `IpAddr`, `Ipv4Addr` and `Ipv6Addr` completions for `Ip`"]
30+
31+
== Internal Improvements
32+
33+
* pr:15745[] (first contribution) add Zed to the manual IDE list.
34+
* pr:15725[] fix automatic `rustc` / `rustdoc` lint generation.
35+
* pr:15618[] port `anymap` to `stdx`.
36+
* pr:15760[] make some `mir::ProjectionStore` methods public.
37+
* pr:15762[] try to use deploy key in the metrics workflow.
38+
* pr:15691[] update `rustc_abi` dependency.

0 commit comments

Comments
 (0)