Skip to content

Commit 01c23bc

Browse files
committed
Changelog #241
1 parent adfad43 commit 01c23bc

File tree

5 files changed

+86
-25
lines changed

5 files changed

+86
-25
lines changed

generated_assists.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Generated by `sourcegen_assists_docs`, do not edit by hand.
1+
//! Generated by `cargo codegen assists-doc-tests`, do not edit by hand.
22

33
[discrete]
44
=== `add_braces`
@@ -1425,7 +1425,7 @@ impl Person {
14251425

14261426
[discrete]
14271427
=== `generate_delegate_trait`
1428-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_trait.rs#L27[generate_delegate_trait.rs]
1428+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_trait.rs#L28[generate_delegate_trait.rs]
14291429

14301430
Generate delegate trait implementation for `StructField`s.
14311431

@@ -2084,7 +2084,7 @@ impl<T: Clone> ${0:_} for Ctx<T> {}
20842084

20852085
[discrete]
20862086
=== `inline_call`
2087-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L164[inline_call.rs]
2087+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L166[inline_call.rs]
20882088

20892089
Inlines a function or method body creating a `let` statement per parameter unless the parameter
20902090
can be inlined. The parameter will be inlined either if it the supplied argument is a simple local
@@ -2135,7 +2135,7 @@ fn something() -> &'static str {
21352135

21362136
[discrete]
21372137
=== `inline_into_callers`
2138-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L27[inline_call.rs]
2138+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L29[inline_call.rs]
21392139

21402140
Inline a function or method body into all of its callers where possible, creating a `let` statement per parameter
21412141
unless the parameter can be inlined. The parameter will be inlined either if it the supplied argument is a simple local
@@ -2824,7 +2824,7 @@ fn main() {
28242824

28252825
[discrete]
28262826
=== `qualify_path`
2827-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/qualify_path.rs#L21[qualify_path.rs]
2827+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/qualify_path.rs#L22[qualify_path.rs]
28282828

28292829
If the name is unresolved, provides all possible qualified paths for it.
28302830

@@ -3358,7 +3358,7 @@ fn handle() {
33583358

33593359
[discrete]
33603360
=== `replace_turbofish_with_explicit_type`
3361-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs#L13[replace_turbofish_with_explicit_type.rs]
3361+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs#L12[replace_turbofish_with_explicit_type.rs]
33623362

33633363
Converts `::<_>` to an explicit type assignment.
33643364

generated_config.adoc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,6 @@ Default:
355355
"description": "Put the expression into a pinned `Box`",
356356
"scope": "expr"
357357
},
358-
"Ok": {
359-
"postfix": "ok",
360-
"body": "Ok(${receiver})",
361-
"description": "Wrap the expression in a `Result::Ok`",
362-
"scope": "expr"
363-
},
364358
"Err": {
365359
"postfix": "err",
366360
"body": "Err(${receiver})",
@@ -372,6 +366,12 @@ Default:
372366
"body": "Some(${receiver})",
373367
"description": "Wrap the expression in an `Option::Some`",
374368
"scope": "expr"
369+
},
370+
"Ok": {
371+
"postfix": "ok",
372+
"body": "Ok(${receiver})",
373+
"description": "Wrap the expression in a `Result::Ok`",
374+
"scope": "expr"
375375
}
376376
}
377377
----
@@ -594,6 +594,11 @@ Whether to prefer import paths containing a `prelude` module.
594594
--
595595
The path structure for newly inserted paths to use.
596596
--
597+
[[rust-analyzer.imports.prefixExternPrelude]]rust-analyzer.imports.prefixExternPrelude (default: `false`)::
598+
+
599+
--
600+
Whether to prefix external (including std, core) crate imports with `::`. e.g. "use ::std::io::Read;".
601+
--
597602
[[rust-analyzer.inlayHints.bindingModeHints.enable]]rust-analyzer.inlayHints.bindingModeHints.enable (default: `false`)::
598603
+
599604
--

generated_diagnostic.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Generated by `sourcegen_diagnostic_docs`, do not edit by hand.
1+
//! Generated by `cargo codegen diagnostics-docs`, do not edit by hand.
22

33
=== break-outside-of-loop
44
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/break_outside_of_loop.rs#L3[break_outside_of_loop.rs]

generated_features.adoc

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ image::https://user-images.githubusercontent.com/48062697/113020654-b42fc800-917
223223

224224

225225
=== Find All References
226-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/references.rs#L44[references.rs]
226+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/references.rs#L42[references.rs]
227227

228228
Shows all references of the item at the cursor location
229229

@@ -270,7 +270,7 @@ Navigates to the declaration of an identifier.
270270

271271
This is the same as `Go to Definition` with the following exceptions:
272272
- outline modules will navigate to the `mod name;` item declaration
273-
- trait assoc items will navigate to the assoc item of the trait declaration opposed to the trait impl
273+
- trait assoc items will navigate to the assoc item of the trait declaration as opposed to the trait impl
274274
- fields in patterns will navigate to the field declaration of the struct, union or variant
275275

276276

@@ -334,7 +334,7 @@ Note: `?`, `|` and `->` do not currently trigger this behavior in the VSCode edi
334334

335335

336336
=== Hover
337-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/hover.rs#L98[hover.rs]
337+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/hover.rs#L101[hover.rs]
338338

339339
Shows additional information, like the type of an expression or the documentation for a definition when "focusing" code.
340340
Focusing is usually hovering with a mouse, but can also be triggered with a shortcut.
@@ -343,7 +343,7 @@ image::https://user-images.githubusercontent.com/48062697/113020658-b5f98b80-917
343343

344344

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

348348
rust-analyzer shows additional information inline with the source code.
349349
Editors usually render this using read-only virtual text snippets interspersed with code.
@@ -360,6 +360,23 @@ Optionally, one can enable additional hints for
360360
* elided lifetimes
361361
* compiler inserted reborrows
362362

363+
Note: inlay hints for function argument names are heuristically omitted to reduce noise and will not appear if
364+
any of the
365+
link:https://github.com/rust-lang/rust-analyzer/blob/6b8b8ff4c56118ddee6c531cde06add1aad4a6af/crates/ide/src/inlay_hints/param_name.rs#L92-L99[following criteria]
366+
are met:
367+
368+
* the parameter name is a suffix of the function's name
369+
* the argument is a qualified constructing or call expression where the qualifier is an ADT
370+
* exact argument<->parameter match(ignoring leading underscore) or parameter is a prefix/suffix
371+
of argument with _ splitting it off
372+
* the parameter name starts with `ra_fixture`
373+
* the parameter name is a
374+
link:https://github.com/rust-lang/rust-analyzer/blob/6b8b8ff4c56118ddee6c531cde06add1aad4a6af/crates/ide/src/inlay_hints/param_name.rs#L200[well known name]
375+
in a unary function
376+
* the parameter name is a
377+
link:https://github.com/rust-lang/rust-analyzer/blob/6b8b8ff4c56118ddee6c531cde06add1aad4a6af/crates/ide/src/inlay_hints/param_name.rs#L201[single character]
378+
in a unary function
379+
363380
image::https://user-images.githubusercontent.com/48062697/113020660-b5f98b80-917a-11eb-8d70-3be3fd558cdd.png[]
364381

365382

@@ -392,7 +409,7 @@ image::https://user-images.githubusercontent.com/48062697/113020661-b6922200-917
392409

393410

394411
=== Magic Completions
395-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/lib.rs#L45[lib.rs]
412+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/lib.rs#L44[lib.rs]
396413

397414
In addition to usual reference completion, rust-analyzer provides some ✨magic✨
398415
completions as well:
@@ -414,6 +431,7 @@ There are postfix completions, which can be triggered by typing something like
414431
- `expr.ref` -> `&expr`
415432
- `expr.refm` -> `&mut expr`
416433
- `expr.let` -> `let $0 = expr;`
434+
- `expr.lete` -> `let $1 = expr else { $0 };`
417435
- `expr.letm` -> `let mut $0 = expr;`
418436
- `expr.not` -> `!expr`
419437
- `expr.dbg` -> `dbg!(expr)`
@@ -556,7 +574,7 @@ image::https://user-images.githubusercontent.com/48062697/113171066-105c2000-923
556574

557575

558576
=== Open Docs
559-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/doc_links.rs#L122[doc_links.rs]
577+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/doc_links.rs#L120[doc_links.rs]
560578

561579
Retrieve a links to documentation for the given symbol.
562580

@@ -585,7 +603,7 @@ image::https://user-images.githubusercontent.com/48062697/113065580-04c21800-91b
585603

586604

587605
=== Related Tests
588-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L195[runnables.rs]
606+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L213[runnables.rs]
589607

590608
Provides a sneak peek of all tests where the current item is used.
591609

@@ -600,7 +618,7 @@ the selected item. The context menu opens. Select **Peek Related Tests**.
600618

601619

602620
=== Rename
603-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/rename.rs#L72[rename.rs]
621+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/rename.rs#L73[rename.rs]
604622

605623
Renames the item below the cursor and all of its references
606624

@@ -614,7 +632,7 @@ image::https://user-images.githubusercontent.com/48062697/113065582-055aae80-91b
614632

615633

616634
=== Run
617-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L111[runnables.rs]
635+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L113[runnables.rs]
618636

619637
Shows a popup suggesting to run a test/benchmark/binary **at the current cursor
620638
location**. Super useful for repeatedly running just a single test. Do bind this
@@ -790,7 +808,7 @@ Randomizes all crate IDs in the crate graph, for debugging.
790808

791809

792810
=== Status
793-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/status.rs#L28[status.rs]
811+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/status.rs#L27[status.rs]
794812

795813
Shows internal statistic about memory usage of rust-analyzer.
796814

@@ -803,7 +821,7 @@ image::https://user-images.githubusercontent.com/48062697/113065584-05f34500-91b
803821

804822

805823
=== Structural Search and Replace
806-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-ssr/src/lib.rs#L8[lib.rs]
824+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-ssr/src/lib.rs#L6[lib.rs]
807825

808826
Search and replace with named wildcards that will match any expression, type, path, pattern or item.
809827
The syntax for a structural search replace command is `<search_pattern> ==>> <replace_pattern>`.
@@ -1036,7 +1054,8 @@ workspace to dependencies.
10361054
Note that filtering does not currently work in VSCode due to the editor never
10371055
sending the special symbols to the language server. Instead, you can configure
10381056
the filtering via the `rust-analyzer.workspace.symbol.search.scope` and
1039-
`rust-analyzer.workspace.symbol.search.kind` settings.
1057+
`rust-analyzer.workspace.symbol.search.kind` settings. Symbols prefixed
1058+
with `__` are hidden from the search results unless configured otherwise.
10401059

10411060
|===
10421061
| Editor | Shortcut
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
= Changelog #241
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:a5b21ea0aa644dffd7cf958b43f11f221d53404e[] +
7+
Release: release:2024-07-08[] (`v0.3.2029`)
8+
9+
== New Features
10+
11+
* pr:17508[] add walkthrough and FAQ pages.
12+
13+
== Fixes
14+
15+
* pr:17523[] (first contribution) add an option to use :: for the external crate prefix.
16+
* pr:17529[] fix lifetime parameters shifting parameter defaults.
17+
* pr:17534[] skip match exhaustiveness checking if pattern type contains errors.
18+
* pr:17536[] don't emit semantic diagnostics in files with a lot of syntax errors.
19+
* pr:17552[] use original source ranges in macro parameter completions.
20+
* pr:17554[] fix `callHierarchy` LSP violation.
21+
* pr:17541[] fix stack overflow on recursive calls with `impl Trait`.
22+
* pr:17494[] don't normalize `use foo::{self}` to `use foo`.
23+
* pr:17546[] diagnose unresolved `self` value in path expressions.
24+
* pr:17549[] fix runnable construction.
25+
* pr:17495[], pr:17548[] pass extra Cargo args when debugging.
26+
27+
== Internal Improvements
28+
29+
* pr:17522[] bump `rustc_pattern_analysis`.
30+
* pr:17551[] set `InferenceResult::has_errors` on error types.
31+
* pr:17526[] improve error message when the proc macro server unexpectedly exits.
32+
* pr:17535[] fix up the syntax tree for macro 2.0.
33+
* pr:17547[] clean up runnable LSP extension.
34+
* pr:17555[] inline generated syntax methods.
35+
* pr:17553[] move remaining codegen things to `xtask codegen`.
36+
* pr:17530[] move lifetimes in front of type and const params.
37+
* pr:17527[] move capability querying out of the config module.

0 commit comments

Comments
 (0)