Skip to content

Commit b2bb6ae

Browse files
committed
Changelog #89
1 parent 1980fb1 commit b2bb6ae

File tree

5 files changed

+113
-11
lines changed

5 files changed

+113
-11
lines changed

generated_assists.adoc

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,31 @@ pub(crate) fn frobnicate() {}
226226
```
227227

228228

229+
[discrete]
230+
=== `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]
232+
233+
Converts an if expression into a corresponding `bool::then` call.
234+
235+
.Before
236+
```rust
237+
fn main() {
238+
if┃ cond {
239+
Some(val)
240+
} else {
241+
None
242+
}
243+
}
244+
```
245+
246+
.After
247+
```rust
248+
fn main() {
249+
cond.then(|| val)
250+
}
251+
```
252+
253+
229254
[discrete]
230255
=== `convert_integer_literal`
231256
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_integer_literal.rs#L5[convert_integer_literal.rs]
@@ -407,7 +432,7 @@ fn qux(bar: Bar, baz: Baz) {}
407432

408433
[discrete]
409434
=== `extract_function`
410-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L31[extract_function.rs]
435+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L32[extract_function.rs]
411436

412437
Extracts selected statements into new function.
413438

@@ -457,7 +482,7 @@ enum A { One(One) }
457482

458483
[discrete]
459484
=== `extract_type_alias`
460-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_type_alias.rs#L8[extract_type_alias.rs]
485+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_type_alias.rs#L10[extract_type_alias.rs]
461486

462487
Extracts the selected type as a type alias.
463488

@@ -1102,9 +1127,9 @@ fn foo(name: Option<&str>) {
11021127

11031128
[discrete]
11041129
=== `inline_local_variable`
1105-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_local_variable.rs#L15[inline_local_variable.rs]
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]
11061131

1107-
Inlines local variable.
1132+
Inlines a local variable.
11081133

11091134
.Before
11101135
```rust
@@ -1592,7 +1617,7 @@ fn main() {
15921617

15931618
[discrete]
15941619
=== `replace_derive_with_manual_impl`
1595-
**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]
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]
15961621

15971622
Converts a `derive` impl into a manual one.
15981623

@@ -1608,8 +1633,8 @@ struct S;
16081633
struct S;
16091634

16101635
impl Debug for S {
1611-
fn fmt(&self, f: &mut Formatter) -> Result<()> {
1612-
${0:todo!()}
1636+
fn fmt(&self, f: &mut Formatter) -> Result<()> {
1637+
f.debug_struct("S").finish()
16131638
}
16141639
}
16151640
```

generated_diagnostic.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
//! Generated by `sourcegen_diagnostic_docs`, do not edit by hand.
22

3+
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
4+
5+
== add-reference-here
6+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_diagnostics/src/handlers/add_reference_here.rs#L8[add_reference_here.rs]
7+
8+
This diagnostic is triggered when there's a missing referencing of expression.
9+
10+
311
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
412

513
== break-outside-of-loop

generated_features.adoc

Lines changed: 4 additions & 3 deletions
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#L74[hover.rs]
259+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L70[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.
@@ -389,7 +389,7 @@ image::https://user-images.githubusercontent.com/48062697/113065573-04298180-91b
389389
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
390390

391391
== Memory Usage
392-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/apply_change.rs#L95[apply_change.rs]
392+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/apply_change.rs#L67[apply_change.rs]
393393

394394
Clears rust-analyzer's internal database and prints memory usage statistics.
395395

@@ -639,8 +639,9 @@ documentation:: Emitted for documentation comments.
639639
injected:: Emitted for doc-string injected highlighting like rust source blocks in documentation.
640640
intraDocLink:: Emitted for intra doc links in doc-strings.
641641
library:: Emitted for items that are defined outside of the current crate.
642+
mutable:: Emitted for mutable locals and statics as well as functions taking `&mut self`.
642643
public:: Emitted for items that are from the current crate and are `pub`.
643-
mutable:: Emitted for mutable locals and statics.
644+
reference: Emitted for locals behind a reference and functions taking `self` by reference.
644645
static:: Emitted for "static" functions, also known as functions that do not take a `self` param, as well as statics and consts.
645646
trait:: Emitted for associated trait items.
646647
unsafe:: Emitted for unsafe operations, like unsafe function calls, as well as the `unsafe` token.

manual.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,8 @@ interface Crate {
622622
/// the `env!` macro
623623
env: : { [key: string]: string; },
624624
625+
/// Whether the crate is a proc-macro crate.
626+
is_proc_macro: bool;
625627
/// For proc-macro crates, path to compiled
626628
/// proc-macro (.so file).
627629
proc_macro_dylib_path?: string;
@@ -641,7 +643,7 @@ Specifically, the `roots` setup will be different eventually.
641643

642644
There are three ways to feed `rust-project.json` to rust-analyzer:
643645

644-
* Place `rust-project.json` file at the root of the project, and rust-anlayzer will discover it.
646+
* Place `rust-project.json` file at the root of the project, and rust-analyzer will discover it.
645647
* Specify `"rust-analyzer.linkedProjects": [ "path/to/rust-project.json" ]` in the settings (and make sure that your LSP client sends settings as a part of initialize request).
646648
* Specify `"rust-analyzer.linkedProjects": [ { "roots": [...], "crates": [...] }]` inline.
647649

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
= Changelog #89
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:5664a2b0b31403024ce5ab927760d630d5ddc9a4[] +
6+
Release: release:2021-08-09[]
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:9752[] (first contribution) support `proc_macro` dependencies in `project.json`.
16+
* pr:9785[] (first contribution) add struct literal completion:
17+
+
18+
image::https://user-images.githubusercontent.com/35599359/128211142-116361e9-7a69-425f-83ea-473c6ea47b26.gif[]
19+
* pr:9814[] generate default code when converting ``#[derive(Debug)]`` to a manual implementation:
20+
+
21+
image::https://user-images.githubusercontent.com/308347/128694292-99a3e694-dd2b-42f5-9e38-798217f433b0.gif[]
22+
* pr:9761[] show coerced types on hover:
23+
+
24+
image::https://user-images.githubusercontent.com/3757771/127883884-2935b624-a3e5-4f35-861a-7d6d3266d187.png[]
25+
+
26+
image::https://user-images.githubusercontent.com/3757771/127883951-4ff96b6b-7576-4886-887b-1198c1121841.png[]
27+
* pr:9800[] include suggested replacement in diagnostics:
28+
+
29+
image::https://user-images.githubusercontent.com/1786438/128521022-c16e0967-6cc6-410d-917d-5db5cfbb96be.png[]
30+
* pr:9810[] add "missing reference" diagnostic:
31+
+
32+
image::https://user-images.githubusercontent.com/308347/128681441-9024a0b1-1ef6-4b3c-92e1-01ac3497aa1e.png[]
33+
* pr:9816[] implement "Convert `if` to ``bool::then``" assist:
34+
+
35+
image::https://user-images.githubusercontent.com/308347/128693801-51eeec03-55e5-4dd8-8fff-5b84251e7a12.gif[]
36+
* pr:9734[] add `reference` semantic highlighting modifier.
37+
* pr:9806[] add support for the 1.56 nightly proc macro ABI.
38+
* pr:9772[] filter out duplicate macro completions.
39+
40+
== Fixes
41+
42+
* pr:9771[] (first contribution) give better error message when the `rust-analyzer` binary path is invalid.
43+
* pr:9801[] don't publish diagnostics in crates.io or sysroot files.
44+
* pr:9762[] fix ranged hover result range.
45+
* pr:9764[] don't use the module as the candidate node in fuzzy path flyimport.
46+
* pr:9770[] downgrade `notify` to fix building on NetBSD.
47+
* pr:9773[] improve the "Extract function" assist.
48+
* pr:9775[] handle ownership in "Extract function".
49+
* pr:9786[] fix detection of macro files in the inactive code diagostic.
50+
* pr:9788[] don't move locals defined outside loops in "Extract function".
51+
* pr:9780[] support `exclusive_range_pattern`.
52+
* pr:9790[] handle generics correctly in "Extract type alias".
53+
* pr:9794[] fix binders with bare `dyn Trait`.
54+
* pr:9808[] gather enum variants and associated trait functions when collecting lang items.
55+
* pr:9812[] add `!` to macro completions with existing argument list.
56+
* pr:9817[] increase `chalk` overflow depth for `tonic`.
57+
58+
== Internal Improvements
59+
60+
* pr:9756[] make `resolve_doc_path` is to resolve to macros.
61+
* pr:9757[] completion cleanups.
62+
* pr:9758[] explain that we don't `ref` in `style.md`.
63+
* pr:9759[] simplify `inline_local_variable` assist.
64+
* pr:9751[] make `LoadCargoConfig`, `fn load_workspace_at` and `fn load_workspace` public again.
65+
* pr:9765[] introduce `TypeInfo` to record coercions and other adjustments.
66+
* pr:9793[] remove unused structs in `ide_db`.

0 commit comments

Comments
 (0)