Skip to content

Commit 8fc33ad

Browse files
committed
Changelog #147
1 parent 278bd90 commit 8fc33ad

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

generated_assists.adoc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,41 @@ fn apply<T, U, F>(f: F, x: T) -> U where F: FnOnce(T) -> U {
18511851
```
18521852

18531853

1854+
[discrete]
1855+
=== `move_format_string_arg`
1856+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_format_string_arg.rs#L12[move_format_string_arg.rs]
1857+
1858+
Move an expression out of a format string.
1859+
1860+
.Before
1861+
```rust
1862+
macro_rules! format_args {
1863+
($lit:literal $(tt:tt)*) => { 0 },
1864+
}
1865+
macro_rules! print {
1866+
($($arg:tt)*) => (std::io::_print(format_args!($($arg)*)));
1867+
}
1868+
1869+
fn main() {
1870+
print!("{x + 1}┃");
1871+
}
1872+
```
1873+
1874+
.After
1875+
```rust
1876+
macro_rules! format_args {
1877+
($lit:literal $(tt:tt)*) => { 0 },
1878+
}
1879+
macro_rules! print {
1880+
($($arg:tt)*) => (std::io::_print(format_args!($($arg)*)));
1881+
}
1882+
1883+
fn main() {
1884+
print!("{}"┃, x + 1);
1885+
}
1886+
```
1887+
1888+
18541889
[discrete]
18551890
=== `move_from_mod_rs`
18561891
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_from_mod_rs.rs#L12[move_from_mod_rs.rs]

generated_config.adoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ cargo check --quiet --workspace --message-format=json --all-targets
4646
Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
4747
avoid checking unnecessary things.
4848
--
49+
[[rust-analyzer.cargo.extraEnv]]rust-analyzer.cargo.extraEnv (default: `{}`)::
50+
+
51+
--
52+
Extra environment variables that will be set when running cargo, rustc
53+
or other commands within the workspace. Useful for setting RUSTFLAGS.
54+
--
4955
[[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`)::
5056
+
5157
--
@@ -93,6 +99,11 @@ Run specified `cargo check` command for diagnostics on save.
9399
--
94100
Extra arguments for `cargo check`.
95101
--
102+
[[rust-analyzer.checkOnSave.extraEnv]]rust-analyzer.checkOnSave.extraEnv (default: `{}`)::
103+
+
104+
--
105+
Extra environment variables that will be set when running `cargo check`.
106+
--
96107
[[rust-analyzer.checkOnSave.features]]rust-analyzer.checkOnSave.features (default: `null`)::
97108
+
98109
--
@@ -353,6 +364,11 @@ Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-i
353364
--
354365
Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.
355366
--
367+
[[rust-analyzer.imports.prefer.no.std]]rust-analyzer.imports.prefer.no.std (default: `false`)::
368+
+
369+
--
370+
Prefer to unconditionally use imports of the core and alloc crate, over the std crate.
371+
--
356372
[[rust-analyzer.imports.prefix]]rust-analyzer.imports.prefix (default: `"plain"`)::
357373
+
358374
--
@@ -474,6 +490,11 @@ client doesn't set the corresponding capability.
474490
Whether to show `Implementations` lens. Only applies when
475491
`#rust-analyzer.lens.enable#` is set.
476492
--
493+
[[rust-analyzer.lens.location]]rust-analyzer.lens.location (default: `"above_name"`)::
494+
+
495+
--
496+
Where to render annotations.
497+
--
477498
[[rust-analyzer.lens.references.adt.enable]]rust-analyzer.lens.references.adt.enable (default: `false`)::
478499
+
479500
--
@@ -546,6 +567,11 @@ This config takes a map of crate names with the exported proc-macro names to ign
546567
Internal config, path to proc-macro server executable (typically,
547568
this is rust-analyzer itself, but we override this in tests).
548569
--
570+
[[rust-analyzer.references.excludeImports]]rust-analyzer.references.excludeImports (default: `false`)::
571+
+
572+
--
573+
Exclude imports from find-all-references.
574+
--
549575
[[rust-analyzer.runnables.command]]rust-analyzer.runnables.command (default: `null`)::
550576
+
551577
--
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
= Changelog #147
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:187bee0bb100111466a3557c20f80defcc0f4db3[] +
6+
Release: release:2022-09-19[]
7+
8+
== New Features
9+
10+
* pr:13058[] (first contribution) allow setting env vars when running `cargo` (`cargo.extraEnv` and `checkOnSave.extraEnv`):
11+
* pr:13221[] (first contribution) add option to move lenses above doc comments (`rust-analyzer.lens.location`):
12+
+
13+
image::https://user-images.githubusercontent.com/33100798/189570298-b4fcbf9c-ee49-4b79-aae6-1037ae4f26af.png[]
14+
* pr:13216[] add `Extract format argument` assist:
15+
+
16+
video::https://user-images.githubusercontent.com/308347/191005574-a90501e8-950c-4620-9c99-95958c9bfea5.mp4[options=loop]
17+
* pr:13212[], pr:13227[] add `rust-analyzer.imports.prefer.no.std` config to unconditionally prefer `core` over `std` imports.
18+
* pr:13186[], pr:13228[] add `rust-analyzer.references.excludeImports` option to filter out imports on `Find all references`.
19+
* pr:13215[] VS Code: remove the `Toggle inlay hints` command.
20+
21+
== Fixes
22+
23+
* pr:13147[], pr:13257[] handle trait methods as inherent methods for trait-related types (fixes resolution of `try_into`).
24+
* pr:13223[], pr:13225[] handle lifetime variables in projection normalization.
25+
* pr:13235[] fix prelude injection.
26+
* pr:13242[] complete variants and associated items in path pattern through type aliases.
27+
* pr:13239[] fix `Add reference` quick fix over macro calls.
28+
29+
== Internal Improvements
30+
31+
* pr:13222[] (first contribution) remove redundant `resolve_obligations_as_possible` call.
32+
* pr:13232[] refactor macro-by-example code.
33+
* pr:13243[] use `memchr::memmem` when searching for usages in `ide-db`.

0 commit comments

Comments
 (0)