Skip to content

Commit 5a17127

Browse files
committed
Changelog #168
1 parent 8fa475a commit 5a17127

File tree

5 files changed

+107
-12
lines changed

5 files changed

+107
-12
lines changed

generated_assists.adoc

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
//! Generated by `sourcegen_assists_docs`, do not edit by hand.
22

3+
[discrete]
4+
=== `add_braces`
5+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_braces.rs#L8[add_braces.rs]
6+
7+
Adds braces to lambda and match arm expressions.
8+
9+
.Before
10+
```rust
11+
fn foo(n: i32) -> i32 {
12+
match n {
13+
1 =>┃ n + 1,
14+
_ => 0
15+
}
16+
}
17+
```
18+
19+
.After
20+
```rust
21+
fn foo(n: i32) -> i32 {
22+
match n {
23+
1 => {
24+
n + 1
25+
},
26+
_ => 0
27+
}
28+
}
29+
```
30+
31+
332
[discrete]
433
=== `add_explicit_type`
534
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_explicit_type.rs#L7[add_explicit_type.rs]
@@ -1717,7 +1746,7 @@ fn main() {
17171746

17181747
[discrete]
17191748
=== `inline_macro`
1720-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_macro.rs#L5[inline_macro.rs]
1749+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_macro.rs#L6[inline_macro.rs]
17211750

17221751
Takes a macro and inlines it one step.
17231752

generated_config.adoc

+13
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ Relative path to the sysroot, or "discover" to try to automatically find it via
9797

9898
Unsetting this disables sysroot loading.
9999

100+
This option does not take effect until rust-analyzer is restarted.
101+
--
102+
[[rust-analyzer.cargo.sysrootSrc]]rust-analyzer.cargo.sysrootSrc (default: `null`)::
103+
+
104+
--
105+
Relative path to the sysroot library sources. If left unset, this will default to
106+
`{cargo.sysroot}/lib/rustlib/src/rust/library`.
107+
100108
This option does not take effect until rust-analyzer is restarted.
101109
--
102110
[[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`)::
@@ -219,6 +227,11 @@ with `self` prefixed to them when inside a method.
219227
--
220228
Whether to add parenthesis and argument snippets when completing function.
221229
--
230+
[[rust-analyzer.completion.limit]]rust-analyzer.completion.limit (default: `null`)::
231+
+
232+
--
233+
Maximum number of completions to return. If `None`, the limit is infinite.
234+
--
222235
[[rust-analyzer.completion.postfix.enable]]rust-analyzer.completion.postfix.enable (default: `true`)::
223236
+
224237
--

generated_features.adoc

+1-1
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#L336[inlay_hints.rs]
344+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L343[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.

manual.adoc

+23-10
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,6 @@ https://docs.helix-editor.com/[Helix] supports LSP by default.
535535
However, it won't install `rust-analyzer` automatically.
536536
You can follow instructions for installing <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
537537

538-
=== Crates
539-
540-
There is a package named `ra_ap_rust_analyzer` available on https://crates.io/crates/ra_ap_rust-analyzer[crates.io], for someone who wants to use it programmatically.
541-
542-
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
543-
544538
=== Visual Studio 2022
545539

546540
There are multiple rust-analyzer extensions for Visual Studio 2022 on Windows:
@@ -577,6 +571,17 @@ https://github.com/sourcegear/rust-vs-extension[GitHub (docs, issues, discussion
577571
* Free (no-cost)
578572
* Supports all editions of Visual Studio 2022 on Windows: Community, Professional, or Enterprise
579573

574+
=== Lapce
575+
576+
https://lapce.dev/[Lapce] has a Rust plugin which you can install directly.
577+
Unfortunately, it downloads an old version of `rust-analyzer`, but you can set the server path under Settings.
578+
579+
=== Crates
580+
581+
There is a package named `ra_ap_rust_analyzer` available on https://crates.io/crates/ra_ap_rust-analyzer[crates.io], for someone who wants to use it programmatically.
582+
583+
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
584+
580585
== Troubleshooting
581586

582587
Start with looking at the rust-analyzer version.
@@ -768,14 +773,18 @@ See https://github.com/rust-analyzer/rust-project.json-example for a small examp
768773

769774
You can set the `RA_LOG` environment variable to `rust_analyzer=info` to inspect how rust-analyzer handles config and project loading.
770775

771-
Note that calls to `cargo check` are disabled when using `rust-project.json` by default, so compilation errors and warnings will no longer be sent to your LSP client. To enable these compilation errors you will need to specify explicitly what command rust-analyzer should run to perform the checks using the `checkOnSave.overrideCommand` configuration. As an example, the following configuration explicitly sets `cargo check` as the `checkOnSave` command.
776+
Note that calls to `cargo check` are disabled when using `rust-project.json` by default, so compilation errors and warnings will no longer be sent to your LSP client.
777+
To enable these compilation errors you will need to specify explicitly what command rust-analyzer should run to perform the checks using the `rust-analyzer.check.overrideCommand` configuration.
778+
As an example, the following configuration explicitly sets `cargo check` as the `check` command.
772779

773780
[source,json]
774781
----
775-
{ "rust-analyzer.checkOnSave.overrideCommand": ["cargo", "check", "--message-format=json"] }
782+
{ "rust-analyzer.check.overrideCommand": ["cargo", "check", "--message-format=json"] }
776783
----
777784

778-
The `checkOnSave.overrideCommand` requires the command specified to output json error messages for rust-analyzer to consume. The `--message-format=json` flag does this for `cargo check` so whichever command you use must also output errors in this format. See the <<Configuration>> section for more information.
785+
`check.overrideCommand` requires the command specified to output json error messages for rust-analyzer to consume.
786+
The `--message-format=json` flag does this for `cargo check` so whichever command you use must also output errors in this format.
787+
See the <<Configuration>> section for more information.
779788

780789
== Security
781790

@@ -816,6 +825,10 @@ include::./generated_assists.adoc[]
816825
While most errors and warnings provided by rust-analyzer come from the `cargo check` integration, there's a growing number of diagnostics implemented using rust-analyzer's own analysis.
817826
Some of these diagnostics don't respect `\#[allow]` or `\#[deny]` attributes yet, but can be turned off using the `rust-analyzer.diagnostics.enable`, `rust-analyzer.diagnostics.experimental.enable` or `rust-analyzer.diagnostics.disabled` settings.
818827

828+
=== Clippy
829+
830+
To run `cargo clippy` instead of `cargo check`, you can set `"rust-analyzer.check.command": "clippy"`.
831+
819832
include::./generated_diagnostic.adoc[]
820833

821834
== Editor Features
@@ -948,7 +961,7 @@ Also note that a full runnable name is something like *run bin_or_example_name*,
948961

949962
Instead of relying on the built-in `cargo check`, you can configure Code to run a command in the background and use the `$rustc-watch` problem matcher to generate inline error markers from its output.
950963

951-
To do this you need to create a new https://code.visualstudio.com/docs/editor/tasks[VS Code Task] and set `rust-analyzer.checkOnSave.enable: false` in preferences.
964+
To do this you need to create a new https://code.visualstudio.com/docs/editor/tasks[VS Code Task] and set `"rust-analyzer.checkOnSave": false` in preferences.
952965

953966
For example, if you want to run https://crates.io/crates/cargo-watch[`cargo watch`] instead, you might add the following to `.vscode/tasks.json`:
954967

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
= Changelog #168
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:646f97385709fab31db2f10661125c0bbbda6b7c[] +
7+
Release: release:2023-02-13[] (`0.3.1402`)
8+
9+
== New Features
10+
11+
* pr:14095[] (first contribution) add `unsafe` postfix completions.
12+
* pr:14098[] (first contribution) add support for `DidChangeWorkspaceFolders` notifications.
13+
* pr:13991[] add an "Add braces: assist:
14+
+
15+
image::https://user-images.githubusercontent.com/4973437/213783924-7c8a8ab5-6a52-4d80-837c-cf2a9b56f061.gif["Screen recording showing an assist that adds braces around the bodies of a closure and a `match` arm"]
16+
* pr:14087[], pr:14094[] support computing layout of RPIT.
17+
* pr:13986[] add a setting to limit the number of completions.
18+
* pr:14127[] build `i686-pc-windows-msvc` binaries.
19+
* pr:14135[] add Lapce installation instructions.
20+
* pr:14134[] add clippy configuration section to the manual.
21+
22+
== Fixes
23+
24+
* pr:14114[] (first contribution) insert spaces when inlining macros.
25+
* pr:14084[] fix parsing of nested tuple field accesses (in a cursed way).
26+
* pr:14092[] don't panic on broken syntax trees in adjustment inlay hints.
27+
* pr:14099[] properly use location links for type hints of `impl Future` and its associated type.
28+
* pr:14103[] don't insert a semicolon when typing `=` if parse errors are encountered.
29+
* pr:14110[] fix completions after functions with no bodies.
30+
* pr:14111[] hide proc macro server version detection errors.
31+
* pr:14125[] don't render bind pattern inlay hints for constants.
32+
* pr:14116[] render discriminant inlay hints for mixed variants if at least one discriminant is specified.
33+
* pr:13975[] suppress extra indent after the end of field and function chains.
34+
35+
== Internal Improvements
36+
37+
* pr:14091[] support sysroot library source being defined inside the workspace.
38+
* pr:14100[] allow specifying what proc-macro server to run in `rust_analyzer::load_cargo`.
39+
* pr:14119[] remove a few allocations in `hir_ty::utils`.
40+
* pr:14090[] unify language configuration folding markers with server behaviour.

0 commit comments

Comments
 (0)