Skip to content

Commit aa188ef

Browse files
committed
Changelog #70
1 parent 122ee67 commit aa188ef

File tree

6 files changed

+124
-11
lines changed

6 files changed

+124
-11
lines changed

generated_assists.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl Trait<u32> for () {
118118

119119
[discrete]
120120
=== `add_lifetime_to_type`
121-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_lifetime_to_type.rs#L6[add_lifetime_to_type.rs]
121+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_lifetime_to_type.rs#L5[add_lifetime_to_type.rs]
122122

123123
Adds a new lifetime to a struct, enum or union.
124124

@@ -1090,7 +1090,7 @@ fn main() {
10901090

10911091
[discrete]
10921092
=== `merge_imports`
1093-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/merge_imports.rs#L13[merge_imports.rs]
1093+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/merge_imports.rs#L10[merge_imports.rs]
10941094

10951095
Merges two imports with a common prefix.
10961096

@@ -1384,7 +1384,7 @@ fn main() {
13841384

13851385
[discrete]
13861386
=== `reorder_fields`
1387-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/reorder_fields.rs#L10[reorder_fields.rs]
1387+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/reorder_fields.rs#L7[reorder_fields.rs]
13881388

13891389
Reorder the fields of record literals and record patterns in the same order as in
13901390
the definition.

generated_config.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ Use markdown syntax for links in hover.
206206
--
207207
Whether to show inlay type hints for method chains.
208208
--
209-
[[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `null`)::
209+
[[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `25`)::
210210
+
211211
--
212-
Maximum length for inlay hints. Default is unlimited.
212+
Maximum length for inlay hints. Set to null to have an unlimited length.
213213
--
214214
[[rust-analyzer.inlayHints.parameterHints]]rust-analyzer.inlayHints.parameterHints (default: `true`)::
215215
+

generated_diagnostic.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ This diagnostic is triggered if created structure does not have field provided i
100100
This diagnostic is triggered when `.filter_map(..).next()` is used, rather than the more concise `.find_map(..)`.
101101

102102

103+
=== unlinked-file
104+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unlinked_file.rs#L23[unlinked_file.rs]
105+
106+
This diagnostic is shown for files that are not included in any crate, or files that are part of
107+
crates rust-analyzer failed to discover. The file will not have IDE features available.
108+
109+
103110
=== unresolved-extern-crate
104111
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L43[diagnostics.rs]
105112

generated_features.adoc

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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#L19[goto_definition.rs]
140+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L15[goto_definition.rs]
141141

142142
Navigates to the definition of an identifier.
143143

@@ -173,7 +173,7 @@ Navigates to the type of an identifier.
173173

174174

175175
=== Hover
176-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L78[hover.rs]
176+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L81[hover.rs]
177177

178178
Shows additional information, like type of an expression or documentation for definition when "focusing" code.
179179
Focusing is usually hovering with a mouse, but can also be triggered with a shortcut.
@@ -293,6 +293,19 @@ Clears rust-analyzer's internal database and prints memory usage statistics.
293293
|===
294294

295295

296+
=== Move Item
297+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/move_item.rs#L16[move_item.rs]
298+
299+
Move item under cursor or selection up and down.
300+
301+
|===
302+
| Editor | Action Name
303+
304+
| VS Code | **Rust Analyzer: Move item up**
305+
| VS Code | **Rust Analyzer: Move item down**
306+
|===
307+
308+
296309
=== On Enter
297310
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/typing/on_enter.rs#L15[on_enter.rs]
298311

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

347360

348361
=== Related Tests
349-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L131[runnables.rs]
362+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L127[runnables.rs]
350363

351364
Provides a sneak peek of all tests where the current item is used.
352365

@@ -362,7 +375,7 @@ The simplest way to use this feature is via the context menu:
362375

363376

364377
=== Rename
365-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/references/rename.rs#L61[rename.rs]
378+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/references/rename.rs#L64[rename.rs]
366379

367380
Renames the item below the cursor and all of its references
368381

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

375388

376389
=== Run
377-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L94[runnables.rs]
390+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L90[runnables.rs]
378391

379392
Shows a popup suggesting to run a test/benchmark/binary **at the current cursor
380393
location**. Super useful for repeatedly running just a single test. Do bind this

manual.adoc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ $ cargo xtask install --server
178178
If your editor can't find the binary even though the binary is on your `$PATH`, the likely explanation is that it doesn't see the same `$PATH` as the shell, see https://github.com/rust-analyzer/rust-analyzer/issues/1811[this issue].
179179
On Unix, running the editor from a shell or changing the `.desktop` file to set the environment should help.
180180

181+
==== `rustup`
182+
183+
`rust-analyzer` is available in `rustup`, but only in the nightly toolchain:
184+
185+
[source,bash]
186+
---
187+
$ rustup +nightly component add rust-analyzer-preview
188+
---
189+
181190
==== Arch Linux
182191

183192
The `rust-analyzer` binary can be installed from the repos or AUR (Arch User Repository):
@@ -480,7 +489,7 @@ interface Crate {
480489
include_dirs: string[],
481490
exclude_dirs: string[],
482491
},
483-
/// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`.
492+
/// The set of cfgs activated for a given crate, like `["unix", "feature=\"foo\"", "feature=\"bar\""]`.
484493
cfg: string[];
485494
/// Target triple for this Crate.
486495
///
@@ -516,6 +525,20 @@ See https://github.com/rust-analyzer/rust-project.json-example for a small examp
516525

517526
You can set `RA_LOG` environmental variable to `rust_analyzer=info` to inspect how rust-analyzer handles config and project loading.
518527

528+
== Security
529+
530+
At the moment, rust-analyzer assumes that all code is trusted.
531+
Here is a **non-exhaustive** list of ways to make rust-analyzer execute arbitrary code:
532+
533+
* proc macros and build scripts are executed by default
534+
* `.cargo/config` can override `rustc` with an arbitrary executable
535+
* VS Code plugin reads configuration from project directory, and that can be used to override paths to various executables, like `rustfmt` or `rust-analyzer` itself.
536+
* rust-analyzer's syntax trees library uses a lot of `unsafe` and hasn't been properly audited for memory safety.
537+
538+
rust-analyzer itself doesn't access the network.
539+
The VS Code plugin doesn't access the network unless the nightly channel is selected in the settings.
540+
In that case, the plugin uses the GitHub API to check for and download updates.
541+
519542
== Features
520543

521544
include::./generated_features.adoc[]
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
= Changelog #70
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:01dc53a31c39fe754c7228646c456325e49e8d09[] +
6+
Release: release:2021-03-29[]
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:8054[] add Move item commands (LSP extension):
16+
+
17+
image::https://user-images.githubusercontent.com/308347/112793739-7e052200-906e-11eb-9ed4-1b396ef7d6dc.gif[]
18+
19+
+
20+
image::https://user-images.githubusercontent.com/308347/112793747-83626c80-906e-11eb-9a96-a075e8d38d6e.gif[]
21+
22+
* pr:8178[] show item info when hovering intra-doc links:
23+
+
24+
image::https://user-images.githubusercontent.com/3757771/112197618-91e2fb00-8c0c-11eb-9edc-a7923214d2b6.gif[]
25+
26+
* pr:8056[] on completion, take into account whether types unify:
27+
+
28+
image::https://user-images.githubusercontent.com/22216761/111338556-46d94e80-8634-11eb-9936-2b20eb9e6756.png[]
29+
30+
+
31+
image::https://user-images.githubusercontent.com/22216761/111338598-4e005c80-8634-11eb-92e0-69c2c1cda6fc.png[]
32+
33+
* pr:8212[] implement basic macros 2.0 support:
34+
+
35+
image::https://user-images.githubusercontent.com/11014119/112712565-6eb99380-8f0b-11eb-88de-5d7f974dfe6d.png[]
36+
37+
== Fixes
38+
39+
* pr:8156[] correctly lower `TraitRef`s with default params.
40+
* pr:8144[] (first contribution) fix crash when trying to display closure types.
41+
* pr:8142[] hide incorrect ref match completions for struct fields/methods.
42+
* pr:8138[] set up a search scope when searching for MBE macro references.
43+
* pr:8159[] try to ignore proc-macro stdout to prevent IPC crashes.
44+
* pr:8182[] trim down IPC JSON size.
45+
* pr:8177[] limit hints size by default.
46+
* pr:8183[] fix spurious "Missing command" lenses on macros.
47+
* pr:8168[] fix "Convert to guarded return" for mutable bindings.
48+
* pr:8189[] document `unlinked-file` diagnostic.
49+
* pr:7907[] take visibility into account for autoderef.
50+
* pr:8194[] finally fix version string display in release binaries.
51+
* pr:8206[] ignore main functions outside of the root module.
52+
* pr:8201[] fix recursive macro statements expansion.
53+
* pr:8213[] include const generic in `impl` generation.
54+
* pr:8214[] mention the `rustup` component in the installation instructions.
55+
* pr:8221[] prefer adding `mod` declaration to `lib.rs` over `file.rs` in `unlinked-file` fix.
56+
* pr:8141[] don't suggest long looping paths for imports.
57+
* pr:8155[] fix confusion between functions and parameters.
58+
* pr:8191[], pr:8209[] fix slight memory leak in syntax.
59+
60+
== Internal Improvements
61+
62+
* pr:8136[], pr:8190[] introduce `QuantifiedWhereClause` and `DynTy` analogous to Chalk.
63+
* pr:8139[] align `Canonical` and `InEnvironment` with the Chalk versions.
64+
* pr:8154[] rewrite "Merge use trees" assist using mutable syntax trees.
65+
* pr:8165[] tweak assist API to fit mutable syntax trees.
66+
* pr:8169[] make more use of the HIR in `rename::rename_to_self`.
67+
* pr:8170[] merge bang-macros and derives in name resolution.
68+
* pr:8187[] sweep the new `TraitEnvironmentQuery`.
69+
* pr:8145[] document our security stance.
70+
* pr:8146[] document patch policy.

0 commit comments

Comments
 (0)