Skip to content

Commit a24f828

Browse files
committed
Changelog #90
1 parent f8979c7 commit a24f828

File tree

4 files changed

+198
-9
lines changed

4 files changed

+198
-9
lines changed

generated_assists.adoc

Lines changed: 125 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() {
4444

4545
[discrete]
4646
=== `add_impl_default_members`
47-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_missing_impl_members.rs#L53[add_missing_impl_members.rs]
47+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_missing_impl_members.rs#L55[add_missing_impl_members.rs]
4848

4949
Adds scaffold for overriding default impl members.
5050

@@ -81,7 +81,7 @@ impl Trait for () {
8181

8282
[discrete]
8383
=== `add_impl_missing_members`
84-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_missing_impl_members.rs#L12[add_missing_impl_members.rs]
84+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_missing_impl_members.rs#L14[add_missing_impl_members.rs]
8585

8686
Adds scaffold for required impl members.
8787

@@ -181,7 +181,7 @@ fn main() {
181181
.After
182182
```rust
183183
fn main() {
184-
if !(x == 4 && !(y < 3.14)) {}
184+
if !(x == 4 && y >= 3.14) {}
185185
}
186186
```
187187

@@ -226,9 +226,34 @@ pub(crate) fn frobnicate() {}
226226
```
227227

228228

229+
[discrete]
230+
=== `convert_bool_then_to_if`
231+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_bool_then.rs#L108[convert_bool_then.rs]
232+
233+
Converts a `bool::then` method call to an equivalent if expression.
234+
235+
.Before
236+
```rust
237+
fn main() {
238+
(0 == 0).then┃(|| val)
239+
}
240+
```
241+
242+
.After
243+
```rust
244+
fn main() {
245+
if 0 == 0 {
246+
Some(val)
247+
} else {
248+
None
249+
}
250+
}
251+
```
252+
253+
229254
[discrete]
230255
=== `convert_if_to_bool_then`
231-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_bool_then.rs#L16[convert_bool_then.rs]
256+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_bool_then.rs#L17[convert_bool_then.rs]
232257

233258
Converts an if expression into a corresponding `bool::then` call.
234259

@@ -328,7 +353,7 @@ fn main() {
328353

329354
[discrete]
330355
=== `convert_to_guarded_return`
331-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/early_return.rs#L21[early_return.rs]
356+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_to_guarded_return.rs#L20[convert_to_guarded_return.rs]
332357

333358
Replace a large conditional with a guarded return.
334359

@@ -1127,7 +1152,7 @@ fn foo(name: Option<&str>) {
11271152

11281153
[discrete]
11291154
=== `inline_local_variable`
1130-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_local_variable.rs#L17[inline_local_variable.rs]
1155+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_local_variable.rs#L19[inline_local_variable.rs]
11311156

11321157
Inlines a local variable.
11331158

@@ -1290,7 +1315,7 @@ fn handle(action: Action) {
12901315

12911316
[discrete]
12921317
=== `move_arm_cond_to_match_guard`
1293-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/move_guard.rs#L68[move_guard.rs]
1318+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/move_guard.rs#L72[move_guard.rs]
12941319

12951320
Moves if expression from match arm body into a guard.
12961321

@@ -1617,7 +1642,7 @@ fn main() {
16171642

16181643
[discrete]
16191644
=== `replace_derive_with_manual_impl`
1620-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_derive_with_manual_impl.rs#L21[replace_derive_with_manual_impl.rs]
1645+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_derive_with_manual_impl.rs#L19[replace_derive_with_manual_impl.rs]
16211646

16221647
Converts a `derive` impl into a manual one.
16231648

@@ -1816,6 +1841,98 @@ fn main() {
18161841
```
18171842

18181843

1844+
[discrete]
1845+
=== `sort_items`
1846+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/sort_items.rs#L12[sort_items.rs]
1847+
1848+
Sorts item members alphabetically: fields, enum variants and methods.
1849+
1850+
.Before
1851+
```rust
1852+
struct ┃Foo┃ { second: u32, first: String }
1853+
```
1854+
1855+
.After
1856+
```rust
1857+
struct Foo { first: String, second: u32 }
1858+
```
1859+
1860+
---
1861+
1862+
.Before
1863+
```rust
1864+
trait ┃Bar┃ {
1865+
fn second(&self) -> u32;
1866+
fn first(&self) -> String;
1867+
}
1868+
```
1869+
1870+
.After
1871+
```rust
1872+
trait Bar {
1873+
fn first(&self) -> String;
1874+
fn second(&self) -> u32;
1875+
}
1876+
```
1877+
1878+
---
1879+
1880+
.Before
1881+
```rust
1882+
struct Baz;
1883+
impl ┃Baz┃ {
1884+
fn second(&self) -> u32;
1885+
fn first(&self) -> String;
1886+
}
1887+
```
1888+
1889+
.After
1890+
```rust
1891+
struct Baz;
1892+
impl Baz {
1893+
fn first(&self) -> String;
1894+
fn second(&self) -> u32;
1895+
}
1896+
```
1897+
1898+
---
1899+
There is a difference between sorting enum variants:
1900+
1901+
.Before
1902+
```rust
1903+
enum ┃Animal┃ {
1904+
Dog(String, f64),
1905+
Cat { weight: f64, name: String },
1906+
}
1907+
```
1908+
1909+
.After
1910+
```rust
1911+
enum Animal {
1912+
Cat { weight: f64, name: String },
1913+
Dog(String, f64),
1914+
}
1915+
```
1916+
1917+
and sorting a single enum struct variant:
1918+
1919+
.Before
1920+
```rust
1921+
enum Animal {
1922+
Dog(String, f64),
1923+
Cat ┃{ weight: f64, name: String }┃,
1924+
}
1925+
```
1926+
1927+
.After
1928+
```rust
1929+
enum Animal {
1930+
Dog(String, f64),
1931+
Cat { name: String, weight: f64 },
1932+
}
1933+
```
1934+
1935+
18191936
[discrete]
18201937
=== `split_import`
18211938
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/split_import.rs#L5[split_import.rs]

generated_features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Highlights constructs related to the thing under the cursor:
256256
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
257257

258258
== Hover
259-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L70[hover.rs]
259+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L89[hover.rs]
260260

261261
Shows additional information, like the type of an expression or the documentation for a definition when "focusing" code.
262262
Focusing is usually hovering with a mouse, but can also be triggered with a shortcut.

manual.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,12 @@ With
467467
----
468468
Then click on apply, and restart the LSP server for your rust project.
469469

470+
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
471+
472+
== juCi++
473+
474+
https://gitlab.com/cppit/jucipp[juCi++] has built-in support for the language server protocol, and since version 1.7.0 offers installation of both Rust and rust-analyzer when opening a Rust file.
475+
470476
== Troubleshooting
471477

472478
Start with looking at the rust-analyzer version.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
= Changelog #90
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:b641a66078ce2f2363e9a3b050ba448b93fb7cb6[] +
6+
Release: release:2021-08-16[]
7+
8+
== Sponsors
9+
10+
**Become a sponsor:** On https://opencollective.com/rust-analyzer/[OpenCollective] or
11+
https://github.com/sponsors/rust-analyzer[GitHub Sponsors].
12+
13+
== New Features
14+
15+
* pr:9828[] (first contribution) use `graphviz-d3` for the crate graph instead of running an installed binary:
16+
+
17+
image::https://user-images.githubusercontent.com/6619062/128995056-9e70197a-3e83-4eda-b813-2485d0800cfe.png[]
18+
* pr:9825[], pr:9835[], pr:9846[], pr:9863[] Generate default impls when converting `Default`, `Hash`, `Clone` or `PartialEq` ``#[derive]``s:
19+
+
20+
image::https://user-images.githubusercontent.com/308347/129512152-622a7445-e424-4780-9d91-17051989e666.gif[]
21+
* pr:9804[] add "Generate method" assist:
22+
+
23+
image::https://user-images.githubusercontent.com/62165556/128745185-4b4674e8-fc5f-45d2-b5a7-22af5c28abfe.gif[]
24+
* pr:9837[] implement "Convert `bool::then` to ``if``" assist:
25+
+
26+
image::https://user-images.githubusercontent.com/308347/129512597-b0f92f9b-a73b-4ca4-847f-678357505878.gif[]
27+
* pr:9856[] show type actions on ranged type hover:
28+
+
29+
image::https://user-images.githubusercontent.com/308347/129512807-c8e79a7e-3693-4847-9a93-a4e5fd2c6443.gif[]
30+
* pr:9735[] add assist to sort members alphabetically:
31+
+
32+
image::https://user-images.githubusercontent.com/308347/129513196-4ffc7937-be58-44d4-9ec7-ba8745dcb460.gif[]
33+
* pr:9879[], pr:9886[] support `if let` match guards.
34+
* pr:9833[] highlight methods that take `self` by value as `consuming`.
35+
36+
37+
== Fixes
38+
39+
* pr:9889[] (first contribution) add setup instructions for the juCi++ editor.
40+
* pr:9845[], pr:9849[] do not drop `..Default::default()` completion when typing `..`.
41+
* pr:9862[] fill out expected type for functional update syntax completion.
42+
* pr:9842[] substitute generic types in "Inline call".
43+
* pr:9860[] fix "Extract function" unnecessarily tagging parameters as `mut`.
44+
* pr:9861[] make "Extract variable" handle selection ranges better.
45+
* pr:9896[] only complete type annotations for patterns in function parameters.
46+
* pr:9823[] avoid some pathological macro expansions.
47+
* pr:9893[] don't use uncached syntax nodes in `generate_function` for `sema` lookups.
48+
* pr:9874[] always add implicit `proc_macro` dependency.
49+
* pr:9871[] jump to generated function after triggering assist.
50+
* pr:9882[] fix source map detection for debugging.
51+
52+
53+
== Internal Improvements
54+
55+
* pr:9832[] (first contribution) switch Code extension from `rollup` to `esbuild`.
56+
* pr:9807[] generate implicit `Sized` bounds for trait solving.
57+
* pr:9826[], pr:9827[] drop latest requests tracking.
58+
* pr:9892[], pr:9897[], pr:9900[], pr:9901[] remove old editing APIs.
59+
* pr:9890[] refactor binary operator handling.
60+
* pr:9834[] unify subcommand handling between `ra` and `xtask`.
61+
* pr:9830[] enable more assists to generate default trait body implementations.
62+
* pr:9838[] document codebase stance on using functional combinators.
63+
* pr:9854[] document that ascription is preferred to a turbofish.
64+
* pr:9841[] print total size of source code in `analysis-stats`.
65+
* pr:9894[] use standard test style.
66+
* pr:9905[] drop `serde_path_to_error` from LSP deserialization to reduce compile time.

0 commit comments

Comments
 (0)