Skip to content

Commit b7c8ec1

Browse files
committed
Changelog 58
1 parent a0d2ff1 commit b7c8ec1

File tree

4 files changed

+97
-3
lines changed

4 files changed

+97
-3
lines changed

generated_assists.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,39 @@ fn qux(bar: Bar, baz: Baz) {}
280280
```
281281

282282

283+
[discrete]
284+
=== `extract_assignment`
285+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/extract_assignment.rs#L12[extract_assignment.rs]
286+
287+
Extracts variable assigment to outside an if or match statement.
288+
289+
.Before
290+
```rust
291+
fn main() {
292+
let mut foo = 6;
293+
294+
if true {
295+
┃foo = 5;
296+
} else {
297+
foo = 4;
298+
}
299+
}
300+
```
301+
302+
.After
303+
```rust
304+
fn main() {
305+
let mut foo = 6;
306+
307+
foo = if true {
308+
5
309+
} else {
310+
4
311+
};
312+
}
313+
```
314+
315+
283316
[discrete]
284317
=== `extract_module_to_file`
285318
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/assists/src/handlers/extract_module_to_file.rs#L10[extract_module_to_file.rs]

generated_features.adoc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ fn main() {
140140

141141
.Fuzzy search details
142142

143-
To avoid an excessive amount of the results returned, completion input is checked for inclusion in the identifiers only
144-
(i.e. in `HashMap` in the `std::collections::HashMap` path), also not in the module indentifiers.
143+
To avoid an excessive amount of the results returned, completion input is checked for inclusion in the names only
144+
(i.e. in `HashMap` in the `std::collections::HashMap` path).
145+
For the same reasons, avoids searching for any imports for inputs with their length less that 2 symbols.
145146

146147
.Merge Behavior
147148

@@ -480,6 +481,16 @@ String::from((y + 5).foo(z))
480481
|===
481482

482483

484+
=== View Hir
485+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/view_hir.rs#L6[view_hir.rs]
486+
487+
|===
488+
| Editor | Action Name
489+
490+
| VS Code | **Rust Analyzer: View Hir**
491+
|===
492+
493+
483494
=== Workspace Symbol
484495
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/symbol_index.rs#L142[symbol_index.rs]
485496

manual.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ The LSP allows various code editors, like VS Code, Emacs or Vim, to implement se
1818
[.lead]
1919
To improve this document, send a pull request: +
2020
https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/manual.adoc[https://github.com/rust-analyzer/.../manual.adoc]
21+
22+
The manual is written in https://asciidoc.org[AsciiDoc] and includes some extra files which are generated from the source code. Run `cargo test` and `cargo xtask codegen` to create these and then `asciidoctor manual.adoc` to create an HTML copy.
23+
2124
====
2225

2326
If you have questions about using rust-analyzer, please ask them in the https://users.rust-lang.org/c/ide/14["`IDEs and Editors`"] topic of Rust users forum.
@@ -339,7 +342,7 @@ interface Crate {
339342
/// Path to the root module of the crate.
340343
root_module: string;
341344
/// Edition of the crate.
342-
edition: "2015" | "2018";
345+
edition: "2015" | "2018" | "2021";
343346
/// Dependencies
344347
deps: Dep[];
345348
/// Should this crate be treated as a member of current "workspace".
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
= Changelog #58
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:5b86ff3e91838e58397ec39502d85056e46fcfcb[] +
6+
Release: release:2021-01-04[]
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:7130[] add extract-assignment assist.
16+
+
17+
image::https://user-images.githubusercontent.com/1711539/103537043-b13b7900-4ea4-11eb-84b3-e570d7b92d98.gif[]
18+
* pr:7091[] `rust-analyzer.server.extraEnv` config to specify environment variables for `rust-analyzer` process.
19+
* pr:7107[] add working dir to cargo metadata fail messages.
20+
* pr:7106[] produce fine-grained diffs when formatting files.
21+
* pr:7071[] pass `--all-targets` to `cargo check` when discovering project structure.
22+
* pr:7080[] initial support for const type parameters.
23+
* pr:7121[] show lifetimes and labels on hover.
24+
* pr:7123[] basic support for 2021 edition.
25+
26+
== Fixes
27+
28+
* pr:7070[] fix `$0` inserted during edits.
29+
* pr:7088[] fix false positive "unnecessary braces" diagnostic.
30+
* pr:7064[] improve auto-importing completion speed and accuracy.
31+
* pr:7059[] fix handling of `$_` in macros.
32+
* pr:7075[] use `.format` to trigger postfix format completion.
33+
* pr:7101[] fix spacing bug in proc-macro.
34+
* pr:7055[] don't swallow the "rustfmt not installed error".
35+
* pr:7102[] fix completion of Default struct update syntax.
36+
* pr:7116[] fix proc-macros for deep trees.
37+
* pr:7125[] don't emit arg count diagnostics for method calls with unknown receiver.
38+
* pr:7134[] fix type-inference for macro generated arrays.
39+
* pr:7136[] fixed nested eager macros.
40+
41+
== Internal Improvements
42+
43+
* pr:7068[] add VSCode command to view the rust-analyzer's hir of a function body.
44+
* pr:7077[], pr:7104[] avoid allocations.
45+
* pr:7113[] manual updates.
46+
* pr:7115[] migrate HasSource::source to return an `Option`.
47+
* pr:7083[] refactor mbe parsing code.

0 commit comments

Comments
 (0)