Skip to content

Commit fcf298b

Browse files
authored
Merge pull request #104 from rust-analyzer/changelog-73
Changelog #73
2 parents 62d261a + cf15b2a commit fcf298b

File tree

6 files changed

+96
-6
lines changed

6 files changed

+96
-6
lines changed

generated_assists.adoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,37 @@ impl Default for Example {
637637
```
638638

639639

640+
[discrete]
641+
=== `generate_deref`
642+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_deref.rs#L15[generate_deref.rs]
643+
644+
Generate `Deref` impl using the given struct field.
645+
646+
.Before
647+
```rust
648+
struct A;
649+
struct B {
650+
┃a: A
651+
}
652+
```
653+
654+
.After
655+
```rust
656+
struct A;
657+
struct B {
658+
a: A
659+
}
660+
661+
impl std::ops::Deref for B {
662+
type Target = A;
663+
664+
fn deref(&self) -> &Self::Target {
665+
&self.a
666+
}
667+
}
668+
```
669+
670+
640671
[discrete]
641672
=== `generate_derive`
642673
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_derive.rs#L9[generate_derive.rs]

generated_config.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ List of features to activate.
3939
--
4040
Run build scripts (`build.rs`) for more precise code analysis.
4141
--
42+
[[rust-analyzer.cargo.useRustcWrapperForBuildScripts]]rust-analyzer.cargo.useRustcWrapperForBuildScripts (default: `true`)::
43+
+
44+
--
45+
Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
46+
avoid compiling unnecessary things.
47+
--
4248
[[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`)::
4349
+
4450
--

generated_diagnostic.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This diagnostic is triggered if the `break` keyword is used outside of a loop.
66

77

88
=== inactive-code
9-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L126[diagnostics.rs]
9+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L127[diagnostics.rs]
1010

1111
This diagnostic is shown for code with inactive `#[cfg]` attributes.
1212

@@ -18,7 +18,7 @@ This diagnostic is triggered if an item name doesn't follow https://doc.rust-lan
1818

1919

2020
=== macro-error
21-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L199[diagnostics.rs]
21+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L200[diagnostics.rs]
2222

2323
This diagnostic is shown for macro expansion errors.
2424

@@ -101,7 +101,7 @@ This diagnostic is triggered when `.filter_map(..).next()` is used, rather than
101101

102102

103103
=== unlinked-file
104-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unlinked_file.rs#L23[unlinked_file.rs]
104+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unlinked_file.rs#L24[unlinked_file.rs]
105105

106106
This diagnostic is shown for files that are not included in any crate, or files that are part of
107107
crates rust-analyzer failed to discover. The file will not have IDE features available.
@@ -133,7 +133,7 @@ This diagnostic is triggered if rust-analyzer is unable to discover referred mod
133133

134134

135135
=== unresolved-proc-macro
136-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L159[diagnostics.rs]
136+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L160[diagnostics.rs]
137137

138138
This diagnostic is shown when a procedural macro can not be found. This usually means that
139139
procedural macro support is simply disabled (and hence is only a weak hint instead of an error),

generated_features.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,14 @@ image::https://user-images.githubusercontent.com/48062697/113065576-04298180-91b
340340

341341

342342
=== On Enter
343-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/typing/on_enter.rs#L15[on_enter.rs]
343+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/typing/on_enter.rs#L16[on_enter.rs]
344344

345345
rust-analyzer can override kbd:[Enter] key to make it smarter:
346346

347347
- kbd:[Enter] inside triple-slash comments automatically inserts `///`
348348
- kbd:[Enter] in the middle or after a trailing space in `//` inserts `//`
349349
- kbd:[Enter] inside `//!` doc comments automatically inserts `//!`
350+
- kbd:[Enter] after `{` indents contents and closing `}` of single-line block
350351

351352
This action needs to be assigned to shortcut explicitly.
352353

manual.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ include::./generated_assists.adoc[]
541541
== Diagnostics
542542

543543
While most errors and warnings provided by rust-analyzer come from the `cargo check` integration, there's a growing number of diagnostics implemented using rust-analyzer's own analysis.
544-
These diagnostics don't respect `#[allow]` or `#[deny]` attributes yet, but can be turned off using the `rust-analyzer.diagnostics.enable`, `rust-analyzer.diagnostics.enableExperimental` or `rust-analyzer.diagnostics.disabled` settings.
544+
Some of these diagnostics don't respect `\#[allow]` or `\#[deny]` attributes yet, but can be turned off using the `rust-analyzer.diagnostics.enable`, `rust-analyzer.diagnostics.enableExperimental` or `rust-analyzer.diagnostics.disabled` settings.
545545

546546
include::./generated_diagnostic.adoc[]
547547

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
= Changelog #73
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:4f94bcd611bd3eb7d845ec1d3909f69ed065699c[] +
6+
Release: release:2021-04-19[]
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:8467[] (first contribution) add "generate `Deref` impl" assist:
16+
+
17+
image::https://user-images.githubusercontent.com/5489149/115183917-9971b480-a091-11eb-98b0-d847543cde01.gif[]
18+
* pr:8476[] avoid checking the whole project during initial loading.
19+
* pr:8481[], pr:8494[], pr:8498[] improve performance by delaying computation of fixes for diagnostics.
20+
* pr:8354[] distinguish between different operators in semantic highlighting.
21+
22+
== Fixes
23+
24+
* pr:8478[] don't spam repeated error messages when `cargo check` fails.
25+
* pr:8496[] exclude `nightly` tag from `git describe` to really fix version string.
26+
* pr:8489[] indent block expressions on enter:
27+
+
28+
image::https://user-images.githubusercontent.com/1786438/114444123-cb38d600-9bce-11eb-8af2-8e8d1c0f9908.gif[]
29+
* pr:8415[] fix faulty assertion when extracting function with macro call.
30+
* pr:8432[] consider outer scopes' ``#[allow]``s in `decl_check`.
31+
* pr:8526[] do not show flyimports in trait or impl declarations.
32+
* pr:8510[] move cursor position when using item movers.
33+
* pr:8536[] (first contribution) slightly improve status messages.
34+
* pr:8543[] (first contribution) fix "Fill match arms" issue with single-element tuples.
35+
* pr:8545[] fix primitive shadowing with inner items.
36+
* pr:8539[] do not propose inherent traits in flyimports and import assists.
37+
* pr:8546[] return `CallInfo` for unclosed call expressions.
38+
* pr:8550[] handle extended key-value attributes in MBE.
39+
* pr:8560[] (first contribution) correctly escape characters in doc comments when passed through macros.
40+
* pr:8561[] accept `E<error_number>` notation in doctests.
41+
* pr:8564[] expand `global_asm!` to nothing.
42+
* pr:8569[] support inherent impls in unnamed consts.
43+
44+
== Internal Improvements
45+
46+
* pr:8483[] clarify who rls-2.0 wg really is.
47+
* pr:8499[] don't use `#[should_panic]` for tests.
48+
* pr:8500[] fix flakiness of "accidentally quadratic?" test.
49+
* pr:8507[] follow test style guide in `typing.rs`.
50+
* pr:8514[], pr:8515[] add more profiling spans to type inference.
51+
* pr:8549[] fix `TestDB::module_at_position` with submodules.
52+
* pr:8551[] (first contribution) nail down `rowan` version.

0 commit comments

Comments
 (0)