Skip to content

Commit b06466e

Browse files
committed
Changelog #215
1 parent d8d5645 commit b06466e

File tree

6 files changed

+111
-28
lines changed

6 files changed

+111
-28
lines changed

generated_assists.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ fn some_function(x: i32) {
366366

367367
[discrete]
368368
=== `bool_to_enum`
369-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/bool_to_enum.rs#L25[bool_to_enum.rs]
369+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/bool_to_enum.rs#L28[bool_to_enum.rs]
370370

371371
This converts boolean local variables, fields, constants, and statics into a new
372372
enum with two variants `Bool::True` and `Bool::False`, as well as replacing
@@ -570,7 +570,7 @@ fn main() {
570570

571571
[discrete]
572572
=== `convert_let_else_to_match`
573-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_let_else_to_match.rs#L8[convert_let_else_to_match.rs]
573+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_let_else_to_match.rs#L9[convert_let_else_to_match.rs]
574574

575575
Converts let-else statement to let statement and match expression.
576576

@@ -1009,7 +1009,7 @@ fn bar(name: i32) -> i32 {
10091009

10101010
[discrete]
10111011
=== `extract_struct_from_enum_variant`
1012-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs#L25[extract_struct_from_enum_variant.rs]
1012+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs#L26[extract_struct_from_enum_variant.rs]
10131013

10141014
Extracts a struct from enum variant.
10151015

@@ -1051,7 +1051,7 @@ struct S {
10511051

10521052
[discrete]
10531053
=== `extract_variable`
1054-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L15[extract_variable.rs]
1054+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L11[extract_variable.rs]
10551055

10561056
Extracts subexpression into a variable.
10571057

@@ -1292,7 +1292,7 @@ impl Person {
12921292

12931293
[discrete]
12941294
=== `generate_delegate_trait`
1295-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_trait.rs#L23[generate_delegate_trait.rs]
1295+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_trait.rs#L26[generate_delegate_trait.rs]
12961296

12971297
Generate delegate trait implementation for `StructField`s.
12981298

@@ -1351,7 +1351,7 @@ impl SomeTrait for B {
13511351
}
13521352

13531353
fn method_(&mut self) -> bool {
1354-
<A as SomeTrait>::method_( &mut self.a )
1354+
<A as SomeTrait>::method_(&mut self.a)
13551355
}
13561356
}
13571357
```
@@ -1631,7 +1631,7 @@ impl From<u32> for A {
16311631

16321632
[discrete]
16331633
=== `generate_function`
1634-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_function.rs#L28[generate_function.rs]
1634+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_function.rs#L29[generate_function.rs]
16351635

16361636
Adds a stub function with a signature matching the function under the cursor.
16371637

@@ -2556,7 +2556,7 @@ fn t() {}
25562556

25572557
[discrete]
25582558
=== `promote_local_to_const`
2559-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/promote_local_to_const.rs#L16[promote_local_to_const.rs]
2559+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/promote_local_to_const.rs#L19[promote_local_to_const.rs]
25602560

25612561
Promotes a local variable to a const item changing its name to a `SCREAMING_SNAKE_CASE` variant
25622562
if the local uses no non-const expressions.
@@ -3024,7 +3024,7 @@ fn handle(action: Action) {
30243024

30253025
[discrete]
30263026
=== `replace_is_some_with_if_let_some`
3027-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs#L5[replace_is_method_with_if_let_method.rs]
3027+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs#L8[replace_is_method_with_if_let_method.rs]
30283028

30293029
Replace `if x.is_some()` with `if let Some(_tmp) = x` or `if x.is_ok()` with `if let Ok(_tmp) = x`.
30303030

generated_config.adoc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ cargo check --quiet --workspace --message-format=json --all-targets
7171
```
7272
.
7373
--
74+
[[rust-analyzer.cargo.buildScripts.rebuildOnSave]]rust-analyzer.cargo.buildScripts.rebuildOnSave (default: `false`)::
75+
+
76+
--
77+
Rerun proc-macros building/build-scripts running when proc-macro
78+
or build-script sources change and are saved.
79+
--
7480
[[rust-analyzer.cargo.buildScripts.useRustcWrapper]]rust-analyzer.cargo.buildScripts.useRustcWrapper (default: `true`)::
7581
+
7682
--
@@ -179,9 +185,9 @@ For example for `cargo check`: `dead_code`, `unused_imports`, `unused_variables`
179185
--
180186
Specifies the working directory for running checks.
181187
- "workspace": run checks for workspaces in the corresponding workspaces' root directories.
182-
This falls back to "root" if `#rust-analyzer.cargo.check.invocationStrategy#` is set to `once`.
188+
This falls back to "root" if `#rust-analyzer.check.invocationStrategy#` is set to `once`.
183189
- "root": run checks in the project's root directory.
184-
This config only has an effect when `#rust-analyzer.cargo.check.overrideCommand#`
190+
This config only has an effect when `#rust-analyzer.check.overrideCommand#`
185191
is set.
186192
--
187193
[[rust-analyzer.check.invocationStrategy]]rust-analyzer.check.invocationStrategy (default: `"per_workspace"`)::
@@ -190,7 +196,7 @@ is set.
190196
Specifies the invocation strategy to use when running the check command.
191197
If `per_workspace` is set, the command will be executed for each workspace.
192198
If `once` is set, the command will be executed once.
193-
This config only has an effect when `#rust-analyzer.cargo.check.overrideCommand#`
199+
This config only has an effect when `#rust-analyzer.check.overrideCommand#`
194200
is set.
195201
--
196202
[[rust-analyzer.check.noDefaultFeatures]]rust-analyzer.check.noDefaultFeatures (default: `null`)::
@@ -215,8 +221,8 @@ Cargo, you might also want to change
215221
If there are multiple linked projects/workspaces, this command is invoked for
216222
each of them, with the working directory being the workspace root
217223
(i.e., the folder containing the `Cargo.toml`). This can be overwritten
218-
by changing `#rust-analyzer.cargo.check.invocationStrategy#` and
219-
`#rust-analyzer.cargo.check.invocationLocation#`.
224+
by changing `#rust-analyzer.check.invocationStrategy#` and
225+
`#rust-analyzer.check.invocationLocation#`.
220226

221227
An example command would be:
222228

@@ -590,6 +596,11 @@ Maximum length for inlay hints. Set to null to have an unlimited length.
590596
Whether to show function parameter name inlay hints at the call
591597
site.
592598
--
599+
[[rust-analyzer.inlayHints.rangeExclusiveHints.enable]]rust-analyzer.inlayHints.rangeExclusiveHints.enable (default: `false`)::
600+
+
601+
--
602+
Whether to show exclusive range inlay hints.
603+
--
593604
[[rust-analyzer.inlayHints.reborrowHints.enable]]rust-analyzer.inlayHints.reborrowHints.enable (default: `"never"`)::
594605
+
595606
--

generated_diagnostic.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Only traits defined in the current crate can be implemented for arbitrary types
149149

150150

151151
=== trait-impl-redundant-assoc_item
152-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs#L6[trait_impl_redundant_assoc_item.rs]
152+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/trait_impl_redundant_assoc_item.rs#L11[trait_impl_redundant_assoc_item.rs]
153153

154154
Diagnoses redundant trait items in a trait impl.
155155

@@ -196,6 +196,12 @@ Diagnostic for unnecessary braces in `use` items.
196196

197197

198198

199+
=== unresolved-assoc-item
200+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_assoc_item.rs#L3[unresolved_assoc_item.rs]
201+
202+
This diagnostic is triggered if the referenced associated item does not exist.
203+
204+
199205
=== unresolved-extern-crate
200206
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_extern_crate.rs#L3[unresolved_extern_crate.rs]
201207

@@ -223,7 +229,7 @@ to a macro in a macro invocation.
223229

224230

225231
=== unresolved-method
226-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_method.rs#L13[unresolved_method.rs]
232+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unresolved_method.rs#L16[unresolved_method.rs]
227233

228234
This diagnostic is triggered if a method does not exist on a given type.
229235

generated_features.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ image::https://user-images.githubusercontent.com/48062697/113020658-b5f98b80-917
341341

342342

343343
=== Inlay Hints
344-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L430[inlay_hints.rs]
344+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L433[inlay_hints.rs]
345345

346346
rust-analyzer shows additional information inline with the source code.
347347
Editors usually render this using read-only virtual text snippets interspersed with code.
@@ -1015,7 +1015,7 @@ Displays the recursive memory layout of a datatype.
10151015

10161016

10171017
=== Workspace Symbol
1018-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-db/src/symbol_index.rs#L181[symbol_index.rs]
1018+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-db/src/symbol_index.rs#L176[symbol_index.rs]
10191019

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

manual.adoc

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,13 @@ $ pacman -S rust-analyzer
186186

187187
==== Gentoo Linux
188188

189-
`rust-analyzer` is available in the GURU repository:
189+
There are two ways to install `rust-analyzer` under Gentoo:
190190

191-
- https://gitweb.gentoo.org/repo/proj/guru.git/tree/dev-util/rust-analyzer?id=9895cea62602cfe599bd48e0fb02127411ca6e81[`dev-util/rust-analyzer`] builds from source
192-
- https://gitweb.gentoo.org/repo/proj/guru.git/tree/dev-util/rust-analyzer-bin?id=9895cea62602cfe599bd48e0fb02127411ca6e81[`dev-util/rust-analyzer-bin`] installs an official binary release
191+
- when installing `dev-lang/rust` or `dev-lang/rust-bin`, enable the `rust-analyzer` and `rust-src` USE flags
192+
- use the `rust-analyzer` component in `rustup` (see instructions above)
193193

194-
If not already, GURU must be enabled (e.g. using `app-eselect/eselect-repository`) and sync'd before running `emerge`:
195-
196-
[source,bash]
197-
----
198-
$ eselect repository enable guru && emaint sync -r guru
199-
$ emerge rust-analyzer-bin
200-
----
194+
Note that in both cases, the version installed lags for a couple of months behind the official releases on GitHub.
195+
To obtain a newer one, you can download a binary from GitHub Releases or building from source.
201196

202197
==== macOS
203198

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
= Changelog #215
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:af40101841c45aa75b56f4e9ca745369da8fb4ba[] +
7+
Release: release:2024-01-08[] (`v0.3.1799`)
8+
9+
== New Features
10+
11+
* pr:16222[] (first contribution) add `unresolved_assoc_item` diagnostic:
12+
+
13+
image::https://user-images.githubusercontent.com/308347/293725355-a5f0627b-890b-4a7b-b450-ef6acac547bb.png["Screenshot showing a diagnostic on a misspelled associated function"]
14+
* pr:16279[] support IDE features for tuple fields:
15+
+
16+
image::https://user-images.githubusercontent.com/308347/294854978-bb047739-2dd4-4a11-a287-6123f4e6d782.png["Screenshot showing hover working on a tuple field, inside a `println!` call"]
17+
* pr:15933[] resolve inherent and implemented associated items in doc comments:
18+
+
19+
image::https://user-images.githubusercontent.com/7189784/293935411-c37ed8b7-b572-4684-8e81-2a817b0027c4.png["Screenshot showing associated methods and consts being highlighted in doc comments"]
20+
* pr:16100[] add quick fix for unresolved methods when an associated function with the same name exists:
21+
+
22+
image::https://user-images.githubusercontent.com/71162630/289863711-1ea1d8b8-3436-4251-a512-e0f9de01a13c.gif["Screen recording showing quick fixes for invalid method calls where an associated method with the same name exists"]
23+
* pr:16011[] add `rust-analyzer.cargo.buildScripts.rebuildOnSave` option to rebuild proc macros on save if they change.
24+
* pr:16223[] add quick fix for "Redundant associated item" diagnostic:
25+
+
26+
image::https://user-images.githubusercontent.com/71162630/293529876-74022c52-1566-49a0-9be8-03b82f3e730f.gif["Screen recording showing a quick fix that adds an implemented method to the corresponding trait definition"]
27+
* pr:16298[] add inlay hint for exclusive ranges:
28+
+
29+
image::https://user-images.githubusercontent.com/94326797/294750534-d6bbc0de-52a5-4af4-b53c-a034749b6cab.png["Screenshot showing inlay hints like 0..<10"]
30+
31+
== Fixes
32+
33+
* pr:16081[] (first contribution) keep trailing whitespace in doc comments.
34+
* pr:16139[] (first contribution) give methods a container name.
35+
* pr:16136[] make the expected completion type a tad smarter with function types:
36+
+
37+
image::https://user-images.githubusercontent.com/29989290/291000125-c06d6c93-5cac-4ebe-a93b-923017a6ae8c.png["Screenshot showing no parantheses when completing a struct field with a function pointer of matching type"]
38+
* pr:16258[], pr:16261[], pr:16267[], pr:16270[] rewrite and optimize `ImportMap::search_dependencies`.
39+
* pr:16268[] remove result limit for trait-importing method completions.
40+
* pr:16153[] tell user that `linkedProjects` is set when failing to discover projects.
41+
* pr:16234[] fix focus range in attribute/derive upmapping.
42+
* pr:16085[] fix type inference with `IndexMut` returning references.
43+
* pr:15810[] fix panic with macros in "Convert boolean to enum" and "Promot local to constant" assists.
44+
* pr:16112[], pr:16264[] rewrite "Generate delegate trait" assist.
45+
* pr:16067[] make "Introduce named generic" assist work with nested types.
46+
* pr:16068[] pick up new generic names on conflict in "Introduce named generic".
47+
* pr:16114[] fix `Self` type replacement in "Inline function".
48+
* pr:16199[] resolve `Self` in "Extract struct from enum variant".
49+
* pr:16049[] don't complete callable parantheses in struct literals.
50+
* pr:16241[] give a userful error when `rustc` cannot be found in explicit sysroot.
51+
* pr:16285[] fix panic on unaligned `#[repr(packed)]`.
52+
* pr:16062[] update `rust-analyzer.cargo.check` documentation references to `rust-analyzer.check`.
53+
54+
== Internal Improvements
55+
56+
* pr:16179[] (first contribution) populate new SCIP `SymbolInformation` fields.
57+
* pr:16213[] (first contribution) update dev guide based on the 2024-01-01 release.
58+
* pr:16252[] (first contribution) switch to `expected.assert_eq` for `ide` tests.
59+
* pr:15922[], pr:16238[], pr:16262[] (first contribution) update Gentoo installation instructions.
60+
* pr:16302[] (first contribution) add a basic `README.md` to the `line-index` crate.
61+
* pr:16290[] reduce `Vec` cloning in MIR lowering and eval.
62+
* pr:16237[] reduce `Arc` allocations in `macro_expand`.
63+
* pr:16082[] migrate assists to the structured snippet API, part 5.
64+
* clean up and enhance readability of `generate_delegate_trait`.
65+
* pr:16226[] expose whether the channel has been dropped in `lsp-server` errors.
66+
* pr:16211[] use `[workspace.lints.clippy]` to configure lints.
67+
* pr:16256[] only compare relevant parts in `ide::{runnables, inlay_hints}` tests.
68+
* pr:16260[] replace single usage of `check_expect` with `check_diagnostics`.
69+
* pr:16294[] fix some minor `clippy::perf` issues.
70+
* pr:16248[] add `proc-macro-test` crate back to the main workspace.
71+
* pr:16249[] sync from downstream.

0 commit comments

Comments
 (0)