Skip to content

Commit 122ee67

Browse files
authored
Merge pull request #94 from rust-analyzer/changelog-69
Changelog #69
2 parents 842d222 + b0d2bbf commit 122ee67

File tree

6 files changed

+162
-18
lines changed

6 files changed

+162
-18
lines changed

generated_assists.adoc

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ fn qux(bar: Bar, baz: Baz) {}
331331

332332
[discrete]
333333
=== `extract_function`
334-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L29[extract_function.rs]
334+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L28[extract_function.rs]
335335

336336
Extracts selected statements into new function.
337337

@@ -840,6 +840,39 @@ impl<T: Clone> Ctx<T> {
840840
```
841841

842842

843+
[discrete]
844+
=== `generate_is_empty_from_len`
845+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_is_empty_from_len.rs#L12[generate_is_empty_from_len.rs]
846+
847+
Generates is_empty implementation from the len method.
848+
849+
.Before
850+
```rust
851+
struct MyStruct { data: Vec<String> }
852+
853+
impl MyStruct {
854+
p┃ub fn len(&self) -> usize {
855+
self.data.len()
856+
}
857+
}
858+
```
859+
860+
.After
861+
```rust
862+
struct MyStruct { data: Vec<String> }
863+
864+
impl MyStruct {
865+
pub fn len(&self) -> usize {
866+
self.data.len()
867+
}
868+
869+
pub fn is_empty(&self) -> bool {
870+
self.len() == 0
871+
}
872+
}
873+
```
874+
875+
843876
[discrete]
844877
=== `generate_new`
845878
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_new.rs#L11[generate_new.rs]
@@ -1136,7 +1169,7 @@ fn handle(action: Action) {
11361169

11371170
[discrete]
11381171
=== `move_bounds_to_where_clause`
1139-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/move_bounds.rs#L10[move_bounds.rs]
1172+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/move_bounds.rs#L8[move_bounds.rs]
11401173

11411174
Moves inline type bounds to a where clause.
11421175

@@ -1242,7 +1275,7 @@ fn main() {
12421275

12431276
[discrete]
12441277
=== `qualify_path`
1245-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/qualify_path.rs#L22[qualify_path.rs]
1278+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/qualify_path.rs#L21[qualify_path.rs]
12461279

12471280
If the name is unresolved, provides all possible qualified paths for it.
12481281

generated_config.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
276276
--
277277
Whether to show `can't find Cargo.toml` error message.
278278
--
279-
[[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `false`)::
279+
[[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`)::
280280
+
281281
--
282282
Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`.

generated_diagnostic.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ This diagnostic is triggered if rust-analyzer is unable to discover imported mod
115115
=== unresolved-macro-call
116116
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L98[diagnostics.rs]
117117

118-
This diagnostic is triggered if rust-analyzer is unable to resolove path to a
118+
This diagnostic is triggered if rust-analyzer is unable to resolve the path to a
119119
macro in a macro invocation.
120120

121121

generated_features.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//Generated file, do not edit by hand, see `xtask/src/codegen`
22
=== Annotations
3-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/annotations.rs#L17[annotations.rs]
3+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/annotations.rs#L18[annotations.rs]
44

55
Provides user with annotations above items for looking up references or impl blocks
66
and running/debugging binaries.
@@ -91,7 +91,7 @@ This is a standard LSP feature and not a protocol extension.
9191

9292

9393
=== File Structure
94-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/file_structure.rs#L18[file_structure.rs]
94+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/file_structure.rs#L25[file_structure.rs]
9595

9696
Provides a tree of the symbols defined in the file. Can be used to
9797

@@ -137,7 +137,7 @@ The following postfix snippets are available:
137137

138138

139139
=== Go to Definition
140-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L16[goto_definition.rs]
140+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L19[goto_definition.rs]
141141

142142
Navigates to the definition of an identifier.
143143

@@ -149,7 +149,7 @@ Navigates to the definition of an identifier.
149149

150150

151151
=== Go to Implementation
152-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_implementation.rs#L7[goto_implementation.rs]
152+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_implementation.rs#L10[goto_implementation.rs]
153153

154154
Navigates to the impl block of structs, enums or traits. Also implemented as a code lens.
155155

@@ -215,7 +215,7 @@ Join selected lines into one, smartly fixing up whitespace, trailing commas, and
215215

216216

217217
=== Magic Completions
218-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/lib.rs#L31[lib.rs]
218+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/lib.rs#L34[lib.rs]
219219

220220
In addition to usual reference completion, rust-analyzer provides some ✨magic✨
221221
completions as well:
@@ -334,7 +334,7 @@ Add the following to `settings.json`:
334334

335335

336336
=== Parent Module
337-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/parent_module.rs#L11[parent_module.rs]
337+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/parent_module.rs#L12[parent_module.rs]
338338

339339
Navigates to the parent module of the current module.
340340

@@ -346,7 +346,7 @@ Navigates to the parent module of the current module.
346346

347347

348348
=== Related Tests
349-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L115[runnables.rs]
349+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L131[runnables.rs]
350350

351351
Provides a sneak peek of all tests where the current item is used.
352352

@@ -374,7 +374,7 @@ Renames the item below the cursor and all of its references
374374

375375

376376
=== Run
377-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L92[runnables.rs]
377+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L94[runnables.rs]
378378

379379
Shows a popup suggesting to run a test/benchmark/binary **at the current cursor
380380
location**. Super useful for repeatedly running just a single test. Do bind this
@@ -501,7 +501,7 @@ be parsed as a valid structural search and replace rule.
501501

502502

503503
=== Workspace Symbol
504-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/symbol_index.rs#L142[symbol_index.rs]
504+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/symbol_index.rs#L148[symbol_index.rs]
505505

506506
Uses fuzzy-search to find types, modules and functions by name across your
507507
project and dependencies. This is **the** most useful feature, which improves code

manual.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,9 @@ If the LSP binary is not available, GNOME Builder can install it when opening a
384384

385385
=== Eclipse IDE
386386

387-
Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
388-
389387
Support for Rust development in the Eclipse IDE is provided by link:https://github.com/eclipse/corrosion[Eclipse Corrosion].
390-
While it currently uses RLS as default, you can successfully configure it so the IDE will use `rust-analyzer` instead.
391-
To do so, with an Eclipse IDE where Corrosion is installed, just go to __Window > Preferences > Rust__ and edit the __Path to Rust Language Server__ entry to reference the path to `rust-analyzer`.
388+
If available in PATH or in some standard location, `rust-analyzer` is detected and powers editing of Rust files without further configuration.
389+
If `rust-analyzer` is not detected, Corrosion will prompt you for configuration of your Rust toolchain and language server with a link to the __Window > Preferences > Rust__ preference page; from here a button allows to download and configure `rust-analyzer`, but you can also reference another installation.
392390
You'll need to close and reopen all .rs and Cargo files, or to restart the IDE, for this change to take effect.
393391

394392
== Configuration
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
= Changelog #69
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:858ad554374a8b1ad67692558a0878391abfdd86[] +
6+
Release: release:2021-03-22[]
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:8000[] add HIR formatter infra and use it for hover text:
16+
+
17+
image::https://user-images.githubusercontent.com/308347/111968849-49d7b180-8b02-11eb-8f0d-4b7bc38d5247.png[]
18+
19+
* pr:8032[] enable proc macros by default (use `rust-analyzer.procMacro.enable` to disable them).
20+
* pr:7966[] add diagnostic for files missing from the module tree.
21+
* pr:7975[] include regions in file structure:
22+
+
23+
image::https://user-images.githubusercontent.com/308347/111967940-4bed4080-8b01-11eb-940a-fc8f81d5673b.gif[]
24+
25+
* pr:8021[] enable reference searching for built-in types:
26+
+
27+
image::https://user-images.githubusercontent.com/3757771/111132711-f69db600-8579-11eb-8c90-22fd6862d11f.png[]
28+
29+
* pr:8020[] power up "Go to implementation":
30+
+
31+
image::https://user-images.githubusercontent.com/3757771/111144403-52bb0700-8587-11eb-9205-7a2a5b8b75a3.png[]
32+
33+
* pr:7992[], pr:8036[] improve completions and completion sorting:
34+
+
35+
image::https://user-images.githubusercontent.com/22216761/111018680-0e551e80-836f-11eb-94b1-c88336ecbc6e.png[]
36+
+
37+
image::https://user-images.githubusercontent.com/22216761/111189395-45941d00-8573-11eb-871b-09186b35cbb9.png[]
38+
39+
* pr:8037[], pr:8040[] add "Generate `is_empty` method from `len` method" assist.
40+
* pr:7900[] show function parameters in completion detail.
41+
* pr:8060[] improve "Move bounds" assist.
42+
* pr:8071[], pr:8086[] highlight intra-doc links in doc comments:
43+
+
44+
image::https://user-images.githubusercontent.com/308347/111969661-27926380-8b03-11eb-8e78-70dc95e137fd.png[]
45+
46+
* pr:8124[] add lifetime completion:
47+
+
48+
image::https://user-images.githubusercontent.com/3757771/111886437-c9b02f80-89cd-11eb-9bee-340f1536b0de.gif[]
49+
50+
* pr:8127[] add label completion:
51+
+
52+
image::https://user-images.githubusercontent.com/3757771/111900839-07946e80-8a35-11eb-90f6-a47943e7501d.gif[]
53+
54+
* pr:8131[] add smart case lookup into flyimport completion:
55+
+
56+
image::https://user-images.githubusercontent.com/308347/111970038-8821a080-8b03-11eb-9bca-b4e06aac565b.png[]
57+
58+
+
59+
image::https://user-images.githubusercontent.com/308347/111970065-8e178180-8b03-11eb-8a33-8aa245401e8a.png[]
60+
61+
== Fixes
62+
63+
* pr:8025[] fix resolution of incomplete fields.
64+
* pr:8015[] make runnable detection more resilient to out-of-tree modules.
65+
* pr:7970[] fix incorrect diagnostics for failing built in macros.
66+
* pr:8044[] fix macro expansion for statements without semicolon.
67+
* pr:8048[] fix missing unresolved macro diagnostic in function body.
68+
* pr:8066[] handle `#[cfg]` on call arguments.
69+
* pr:8068[] handle `#[cfg]` on function parameters.
70+
* pr:8067[] check whether cursor is on and not between intra-doc links in `goto_definition`.
71+
* pr:8073[] improve diagnostic when including nonexistent file.
72+
* pr:8075[] fix `use crate as <name>;` imports.
73+
* pr:8078[] support `#[cfg]` on all associated items.
74+
* pr:8082[] properly handle inner recursive `macro_rules!`.
75+
* pr:8088[] fix "Go to definition" and highlighting for function-like proc macros.
76+
* pr:8089[] update info about Eclipse Corrosion.
77+
* pr:8094[] fix infinite recursion when computing diagnostics for inner items.
78+
* pr:8083[] track source file IDs in source mapping of `Attrs`.
79+
* pr:8108[] fix handling of `#![cfg]` in outline module files.
80+
* pr:8122[] make bare underscore token an `Ident` rather than `Punct` in proc-macro.
81+
* pr:8123[] do not display unqualified associated item completions.
82+
* pr:8128[] expand legacy-scoped macro during collection.
83+
* pr:8133[] fix `salsa` panic.
84+
* pr:8134[] (first contribution) fix module resolution in `include!`ed files.
85+
* pr:8137[] fix box pattern inference panic.
86+
87+
88+
== Internal Improvements
89+
90+
* pr:7498[] switch to a mutable syntax tree implementation.
91+
* pr:8023[] move `StructureNodeKind` from `ide_db` to `ide`.
92+
* pr:8022[] fix some `clippy` performance warnings.
93+
* pr:8026[] simplify source maps for fields.
94+
* pr:8018[], pr:8038[] make `Ty` wrap `TyKind` in an `Arc`.
95+
* pr:8008[] clean up `CompletionContext::expected_type`.
96+
* pr:8030[] add `diesel` to the benchmark suite.
97+
* pr:8029[] enable thread-local coverage mark support.
98+
* pr:8035[] `unqualfied_path` completions aren't responsible for variant pattern completions.
99+
* pr:8028[] prepare for returning parents in the "Locate parent module" command.
100+
* pr:8039[] use `SmallVec` for `Substs`.
101+
* pr:8046[] add `match` vs. `if let ... else` entry to the style guide.
102+
* pr:8034[] implement `Crate::transitive_reverse_dependencies`.
103+
* pr:8042[] (first contribution) add `rustc-perf` version to the metrics JSON.
104+
* pr:8061[] structural editing API can automatically insert whitespace in simple cases.
105+
* pr:8059[] support `cfg_attr` in doc-comment syntax highlighting.
106+
* pr:8065[] handle block doc comments better.
107+
* pr:8069[] support highlight injection in block doc comments.
108+
* pr:8080[] change `ItemTree` API to accomodate creating an `ItemTree` per block expression.
109+
* pr:8087[] make MacroDefId's `AstId` mandatory when possible.
110+
* pr:8093[] record custom derive helpers in `DefMap`.
111+
* pr:8097[] parse `extended_key_value_attributes`.
112+
* pr:8112[] revamp `hir_def` attribute API.
113+
* pr:8125[] don't use an untyped `String` for ActiveParam tracking.

0 commit comments

Comments
 (0)