Skip to content

Commit 2ece613

Browse files
authored
Merge pull request #107 from rust-analyzer/changelog-74
Changelog #74
2 parents c31f2c2 + a401d25 commit 2ece613

File tree

5 files changed

+167
-33
lines changed

5 files changed

+167
-33
lines changed

generated_assists.adoc

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,51 @@ fn main() {
329329
```
330330

331331

332+
[discrete]
333+
=== `convert_tuple_struct_to_named_struct`
334+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_tuple_struct_to_named_struct.rs#L9[convert_tuple_struct_to_named_struct.rs]
335+
336+
Converts tuple struct to struct with named fields.
337+
338+
.Before
339+
```rust
340+
struct Point┃(f32, f32);
341+
342+
impl Point {
343+
pub fn new(x: f32, y: f32) -> Self {
344+
Point(x, y)
345+
}
346+
347+
pub fn x(&self) -> f32 {
348+
self.0
349+
}
350+
351+
pub fn y(&self) -> f32 {
352+
self.1
353+
}
354+
}
355+
```
356+
357+
.After
358+
```rust
359+
struct Point { field1: f32, field2: f32 }
360+
361+
impl Point {
362+
pub fn new(x: f32, y: f32) -> Self {
363+
Point { field1: x, field2: y }
364+
}
365+
366+
pub fn x(&self) -> f32 {
367+
self.field1
368+
}
369+
370+
pub fn y(&self) -> f32 {
371+
self.field2
372+
}
373+
}
374+
```
375+
376+
332377
[discrete]
333378
=== `expand_glob_import`
334379
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/expand_glob_import.rs#L18[expand_glob_import.rs]
@@ -457,7 +502,7 @@ fn main() {
457502

458503
[discrete]
459504
=== `fill_match_arms`
460-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/fill_match_arms.rs#L14[fill_match_arms.rs]
505+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/fill_match_arms.rs#L15[fill_match_arms.rs]
461506

462507
Adds missing clauses to a `match` expression.
463508

@@ -1058,7 +1103,7 @@ fn main() {
10581103

10591104
[discrete]
10601105
=== `inline_local_variable`
1061-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_local_variable.rs#L13[inline_local_variable.rs]
1106+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_local_variable.rs#L15[inline_local_variable.rs]
10621107

10631108
Inlines local variable.
10641109

@@ -1080,7 +1125,7 @@ fn main() {
10801125

10811126
[discrete]
10821127
=== `introduce_named_lifetime`
1083-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/introduce_named_lifetime.rs#L12[introduce_named_lifetime.rs]
1128+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/introduce_named_lifetime.rs#L13[introduce_named_lifetime.rs]
10841129

10851130
Change an anonymous lifetime to a named lifetime.
10861131

@@ -1489,7 +1534,7 @@ const test: Foo = Foo {foo: 1, bar: 0}
14891534

14901535
[discrete]
14911536
=== `reorder_impl`
1492-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/reorder_impl.rs#L14[reorder_impl.rs]
1537+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/reorder_impl.rs#L13[reorder_impl.rs]
14931538

14941539
Reorder the methods of an `impl Trait`. The methods will be ordered
14951540
in the same order as in the trait definition.
@@ -1529,7 +1574,7 @@ impl Foo for Bar {
15291574

15301575
[discrete]
15311576
=== `replace_derive_with_manual_impl`
1532-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_derive_with_manual_impl.rs#L20[replace_derive_with_manual_impl.rs]
1577+
**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]
15331578

15341579
Converts a `derive` impl into a manual one.
15351580

generated_config.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ have more false positives than usual.
147147
--
148148
List of rust-analyzer diagnostics to disable.
149149
--
150+
[[rust-analyzer.diagnostics.remapPrefix]]rust-analyzer.diagnostics.remapPrefix (default: `{}`)::
151+
+
152+
--
153+
Map of prefixes to be substituted when parsing diagnostic file paths.
154+
This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.
155+
--
150156
[[rust-analyzer.diagnostics.warningsAsHint]]rust-analyzer.diagnostics.warningsAsHint (default: `[]`)::
151157
+
152158
--

generated_features.adoc

Lines changed: 2 additions & 2 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
=== Expand Macro Recursively
71-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/expand_macro.rs#L19[expand_macro.rs]
71+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/expand_macro.rs#L17[expand_macro.rs]
7272

7373
Shows the full macro expansion of the macro at current cursor.
7474

@@ -418,7 +418,7 @@ The simplest way to use this feature is via the context menu:
418418

419419

420420
=== Rename
421-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/references/rename.rs#L64[rename.rs]
421+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/references/rename.rs#L75[rename.rs]
422422

423423
Renames the item below the cursor and all of its references
424424

manual.adoc

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -429,70 +429,92 @@ However, if you use some other build system, you'll have to describe the structu
429429
[source,TypeScript]
430430
----
431431
interface JsonProject {
432-
/// Path to the directory with *source code* of sysroot crates.
432+
/// Path to the directory with *source code* of
433+
/// sysroot crates.
434+
///
435+
/// It should point to the directory where std,
436+
/// core, and friends can be found:
433437
///
434-
/// It should point to the directory where std, core, and friends can be found:
435438
/// https://github.com/rust-lang/rust/tree/master/library.
436439
///
437-
/// If provided, rust-analyzer automatically adds dependencies on sysroot
438-
/// crates. Conversely, if you omit this path, you can specify sysroot
439-
/// dependencies yourself and, for example, have several different "sysroots" in
440-
/// one graph of crates.
440+
/// If provided, rust-analyzer automatically adds
441+
/// dependencies on sysroot crates. Conversely,
442+
/// if you omit this path, you can specify sysroot
443+
/// dependencies yourself and, for example, have
444+
/// several different "sysroots" in one graph of
445+
/// crates.
441446
sysroot_src?: string;
442-
/// The set of crates comprising the current project.
443-
/// Must include all transitive dependencies as well as sysroot crate (libstd, libcore and such).
447+
/// The set of crates comprising the current
448+
/// project. Must include all transitive
449+
/// dependencies as well as sysroot crate (libstd,
450+
/// libcore and such).
444451
crates: Crate[];
445452
}
446453
447454
interface Crate {
448-
/// Optional crate name used for display purposes, without affecting semantics.
449-
/// See the `deps` key for semantically-significant crate names.
455+
/// Optional crate name used for display purposes,
456+
/// without affecting semantics. See the `deps`
457+
/// key for semantically-significant crate names.
450458
display_name?: string;
451459
/// Path to the root module of the crate.
452460
root_module: string;
453461
/// Edition of the crate.
454462
edition: "2015" | "2018" | "2021";
455463
/// Dependencies
456464
deps: Dep[];
457-
/// Should this crate be treated as a member of current "workspace".
465+
/// Should this crate be treated as a member of
466+
/// current "workspace".
458467
///
459-
/// By default, inferred from the `root_module` (members are the crates which reside
460-
/// inside the directory opened in the editor).
468+
/// By default, inferred from the `root_module`
469+
/// (members are the crates which reside inside
470+
/// the directory opened in the editor).
461471
///
462-
/// Set this to `false` for things like standard library and 3rd party crates to
463-
/// enable performance optimizations (rust-analyzer assumes that non-member crates
464-
/// don't change).
472+
/// Set this to `false` for things like standard
473+
/// library and 3rd party crates to enable
474+
/// performance optimizations (rust-analyzer
475+
/// assumes that non-member crates don't change).
465476
is_workspace_member?: boolean;
466-
/// Optionally specify the (super)set of `.rs` files comprising this crate.
477+
/// Optionally specify the (super)set of `.rs`
478+
/// files comprising this crate.
467479
///
468-
/// By default, rust-analyzer assumes that only files under `root_module.parent` can belong to a crate.
469-
/// `include_dirs` are included recursively, unless a subdirectory is in `exclude_dirs`.
480+
/// By default, rust-analyzer assumes that only
481+
/// files under `root_module.parent` can belong
482+
/// to a crate. `include_dirs` are included
483+
/// recursively, unless a subdirectory is in
484+
/// `exclude_dirs`.
470485
///
471486
/// Different crates can share the same `source`.
472487
///
473-
/// If two crates share an `.rs` file in common, they *must* have the same `source`.
474-
/// rust-analyzer assumes that files from one source can't refer to files in another source.
488+
/// If two crates share an `.rs` file in common,
489+
/// they *must* have the same `source`.
490+
/// rust-analyzer assumes that files from one
491+
/// source can't refer to files in another source.
475492
source?: {
476493
include_dirs: string[],
477494
exclude_dirs: string[],
478495
},
479-
/// The set of cfgs activated for a given crate, like `["unix", "feature=\"foo\"", "feature=\"bar\""]`.
496+
/// The set of cfgs activated for a given crate, like
497+
/// `["unix", "feature=\"foo\"", "feature=\"bar\""]`.
480498
cfg: string[];
481499
/// Target triple for this Crate.
482500
///
483-
/// Used when running `rustc --print cfg` to get target-specific cfgs.
501+
/// Used when running `rustc --print cfg`
502+
/// to get target-specific cfgs.
484503
target?: string;
485-
/// Environment variables, used for the `env!` macro
504+
/// Environment variables, used for
505+
/// the `env!` macro
486506
env: : { [key: string]: string; },
487507
488-
/// For proc-macro crates, path to compiles proc-macro (.so file).
508+
/// For proc-macro crates, path to compiled
509+
/// proc-macro (.so file).
489510
proc_macro_dylib_path?: string;
490511
}
491512
492513
interface Dep {
493514
/// Index of a crate in the `crates` array.
494515
crate: number,
495-
/// Name as should appear in the (implicit) `extern crate name` declaration.
516+
/// Name as should appear in the (implicit)
517+
/// `extern crate name` declaration.
496518
name: string,
497519
}
498520
----
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
= Changelog #74
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:617535393bb5ccc7adf0bac8a3b9a9c306454e79[] +
6+
Release: release:2021-04-26[]
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+
+
19+
This feature was included in the last week's changelog by mistake.
20+
* pr:8317[] add "Convert tuple to named struct" assist:
21+
+
22+
image::https://user-images.githubusercontent.com/308347/116033884-ebef3a00-a66a-11eb-8e34-f95afe788a30.gif[]
23+
* pr:8462[] expand macros in type positions.
24+
* pr:8621[] make sure nightly regressions don't break users.
25+
* pr:8570[] parse `rustc` error messages in flycheck for non-Cargo build systems.
26+
* pr:8595[] add support for remapping diagnostic paths.
27+
28+
29+
== Fixes
30+
31+
* pr:8611[] (first contribution) add support for boolean values to "Fill match arms".
32+
* pr:8658[] (first contribution) check more carefully for cases when a rename can't be done.
33+
* pr:8582[] (first contribution) fix typo in `comparison` semantic token type.
34+
* pr:8600[] fix project loading hang.
35+
* pr:8606[] fix "Registering progress handler" error.
36+
* pr:8639[] fix `configuration.property` startup error in VS Code.
37+
* pr:8643[] change version string to contain hash, build date and channel.
38+
* pr:8524[] fix "Extract function" with partial block selection.
39+
* pr:8540[] prevent renaming items that are not part of the workspace (LSP extension).
40+
* pr:8565[] "Fill match arms" assist: add remaining arms for enum tuples.
41+
* pr:8577[] support crates/module roots in `external_docs`.
42+
* pr:8578[] fix inner attributes false positives in docs.
43+
* pr:8587[] fix some `find_path` bugs around inner items (fixes auto-imports with macro calls).
44+
* pr:8601[] trigger "Inline variable" assist on variable usages.
45+
* pr:8609[] parse outer attributes for `RecordPatField`.
46+
* pr:8620[] avoid unnecessary braces in "Extract function".
47+
* pr:8602[] fix panic in "Replace derive with manual implementation".
48+
49+
== Internal Improvements
50+
51+
* pr:8502[] document review requesting etiquette.
52+
* pr:8527[] rewrite "Introduce named lifetime" assist to use mutable syntax trees.
53+
* pr:8579[] fix "Server status" capability name in docs.
54+
* pr:8580[] remove confusion around `serverStatusNotification`.
55+
* pr:8584[] fix slightly broken test.
56+
* pr:8586[] replace `SyntaxRewriter` usage with `ted` in `eager::eager_macro_recur`.
57+
* pr:8588[] add guidelines for release notes PR descriptions.
58+
* pr:8605[] automatically categorize the changelog entries.
59+
* pr:8591[] remove `SyntaxRewriter` usage in `insert_use` in favor of mutable syntax trees.
60+
* pr:8638[] remove `SyntaxRewriter::from_fn`.
61+
* pr:8647[] split out `merge_imports` module from `helpers::insert_use`.

0 commit comments

Comments
 (0)