Skip to content

Commit fd8ec09

Browse files
committed
Changelog #230
1 parent 4b03015 commit fd8ec09

File tree

4 files changed

+169
-48
lines changed

4 files changed

+169
-48
lines changed

generated_assists.adoc

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,39 @@ fn main() {
468468
```
469469

470470

471+
[discrete]
472+
=== `convert_from_to_tryfrom`
473+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_from_to_tryfrom.rs#L10[convert_from_to_tryfrom.rs]
474+
475+
Converts a From impl to a TryFrom impl, wrapping returns in `Ok`.
476+
477+
.Before
478+
```rust
479+
impl ┃From<usize> for Thing {
480+
fn from(val: usize) -> Self {
481+
Thing {
482+
b: val.to_string(),
483+
a: val
484+
}
485+
}
486+
}
487+
```
488+
489+
.After
490+
```rust
491+
impl TryFrom<usize> for Thing {
492+
type Error = ${0:()};
493+
494+
fn try_from(val: usize) -> Result<Self, Self::Error> {
495+
Ok(Thing {
496+
b: val.to_string(),
497+
a: val
498+
})
499+
}
500+
}
501+
```
502+
503+
471504
[discrete]
472505
=== `convert_if_to_bool_then`
473506
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_bool_then.rs#L20[convert_bool_then.rs]
@@ -3651,3 +3684,26 @@ fn foo() -> i32┃ { 42i32 }
36513684
```rust
36523685
fn foo() -> Result<i32, ${0:_}> { Ok(42i32) }
36533686
```
3687+
3688+
3689+
[discrete]
3690+
=== `wrap_unwrap_cfg_attr`
3691+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/wrap_unwrap_cfg_attr.rs#L12[wrap_unwrap_cfg_attr.rs]
3692+
3693+
Wraps an attribute to a cfg_attr attribute or unwraps a cfg_attr attribute to the inner attributes.
3694+
3695+
.Before
3696+
```rust
3697+
#[derive┃(Debug)]
3698+
struct S {
3699+
field: i32
3700+
}
3701+
```
3702+
3703+
.After
3704+
```rust
3705+
#[cfg_attr(┃, derive(Debug))]
3706+
struct S {
3707+
field: i32
3708+
}
3709+
```

generated_config.adoc

Lines changed: 69 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,18 @@ or build-script sources change and are saved.
8888
Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
8989
avoid checking unnecessary things.
9090
--
91-
[[rust-analyzer.cargo.cfgs]]rust-analyzer.cargo.cfgs (default: `{}`)::
91+
[[rust-analyzer.cargo.cfgs]]rust-analyzer.cargo.cfgs::
9292
+
9393
--
94+
Default:
95+
----
96+
{
97+
"debug_assertions": null,
98+
"miri": null
99+
}
100+
----
94101
List of cfg options to enable with the given values.
102+
95103
--
96104
[[rust-analyzer.cargo.extraArgs]]rust-analyzer.cargo.extraArgs (default: `[]`)::
97105
+
@@ -159,11 +167,6 @@ building from locking the `Cargo.lock` at the expense of duplicating build artif
159167
Set to `true` to use a subdirectory of the existing target directory or
160168
set to a path relative to the workspace to use that path.
161169
--
162-
[[rust-analyzer.cargo.unsetTest]]rust-analyzer.cargo.unsetTest (default: `["core"]`)::
163-
+
164-
--
165-
Unsets the implicit `#[cfg(test)]` for the specified crates.
166-
--
167170
[[rust-analyzer.checkOnSave]]rust-analyzer.checkOnSave (default: `true`)::
168171
+
169172
--
@@ -321,46 +324,46 @@ Enables completions of private items and fields that are defined in the current
321324
Default:
322325
----
323326
{
324-
"Arc::new": {
325-
"postfix": "arc",
326-
"body": "Arc::new(${receiver})",
327-
"requires": "std::sync::Arc",
328-
"description": "Put the expression into an `Arc`",
329-
"scope": "expr"
330-
},
331-
"Rc::new": {
332-
"postfix": "rc",
333-
"body": "Rc::new(${receiver})",
334-
"requires": "std::rc::Rc",
335-
"description": "Put the expression into an `Rc`",
336-
"scope": "expr"
337-
},
338-
"Box::pin": {
339-
"postfix": "pinbox",
340-
"body": "Box::pin(${receiver})",
341-
"requires": "std::boxed::Box",
342-
"description": "Put the expression into a pinned `Box`",
343-
"scope": "expr"
344-
},
345-
"Ok": {
346-
"postfix": "ok",
347-
"body": "Ok(${receiver})",
348-
"description": "Wrap the expression in a `Result::Ok`",
349-
"scope": "expr"
350-
},
351-
"Err": {
352-
"postfix": "err",
353-
"body": "Err(${receiver})",
354-
"description": "Wrap the expression in a `Result::Err`",
355-
"scope": "expr"
356-
},
357-
"Some": {
358-
"postfix": "some",
359-
"body": "Some(${receiver})",
360-
"description": "Wrap the expression in an `Option::Some`",
361-
"scope": "expr"
362-
}
363-
}
327+
"Arc::new": {
328+
"postfix": "arc",
329+
"body": "Arc::new(${receiver})",
330+
"requires": "std::sync::Arc",
331+
"description": "Put the expression into an `Arc`",
332+
"scope": "expr"
333+
},
334+
"Rc::new": {
335+
"postfix": "rc",
336+
"body": "Rc::new(${receiver})",
337+
"requires": "std::rc::Rc",
338+
"description": "Put the expression into an `Rc`",
339+
"scope": "expr"
340+
},
341+
"Box::pin": {
342+
"postfix": "pinbox",
343+
"body": "Box::pin(${receiver})",
344+
"requires": "std::boxed::Box",
345+
"description": "Put the expression into a pinned `Box`",
346+
"scope": "expr"
347+
},
348+
"Ok": {
349+
"postfix": "ok",
350+
"body": "Ok(${receiver})",
351+
"description": "Wrap the expression in a `Result::Ok`",
352+
"scope": "expr"
353+
},
354+
"Err": {
355+
"postfix": "err",
356+
"body": "Err(${receiver})",
357+
"description": "Wrap the expression in a `Result::Err`",
358+
"scope": "expr"
359+
},
360+
"Some": {
361+
"postfix": "some",
362+
"body": "Some(${receiver})",
363+
"description": "Wrap the expression in an `Option::Some`",
364+
"scope": "expr"
365+
}
366+
}
364367
----
365368
Custom completion snippets.
366369

@@ -775,7 +778,8 @@ Disable project auto-discovery in favor of explicitly specified set
775778
of projects.
776779

777780
Elements must be paths pointing to `Cargo.toml`,
778-
`rust-project.json`, or JSON objects in `rust-project.json` format.
781+
`rust-project.json`, `.rs` files (which will be treated as standalone files) or JSON
782+
objects in `rust-project.json` format.
779783
--
780784
[[rust-analyzer.lru.capacity]]rust-analyzer.lru.capacity (default: `null`)::
781785
+
@@ -844,6 +848,24 @@ Command to be executed instead of 'cargo' for runnables.
844848
--
845849
Additional arguments to be passed to cargo for runnables such as
846850
tests or binaries. For example, it may be `--release`.
851+
--
852+
[[rust-analyzer.runnables.extraTestBinaryArgs]]rust-analyzer.runnables.extraTestBinaryArgs::
853+
+
854+
--
855+
Default:
856+
----
857+
[
858+
"--show-output"
859+
]
860+
----
861+
Additional arguments to be passed through Cargo to launched tests, benchmarks, or
862+
doc-tests.
863+
864+
Unless the launched target uses a
865+
[custom test harness](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field),
866+
they will end up being interpreted as options to
867+
[`rustc`’s built-in test harness (“libtest”)](https://doc.rust-lang.org/rustc/tests/index.html#cli-arguments).
868+
847869
--
848870
[[rust-analyzer.rustc.source]]rust-analyzer.rustc.source (default: `null`)::
849871
+

generated_diagnostic.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,6 @@ This diagnostic is triggered when a mutable variable isn't actually mutated.
286286

287287

288288
=== unused-variables
289-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unused_variables.rs#L11[unused_variables.rs]
289+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-diagnostics/src/handlers/unused_variables.rs#L14[unused_variables.rs]
290290

291291
This diagnostic is triggered when a local variable is not used.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
= Changelog #230
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:47a901b9bf1f99b1ec5222d478684fc412d526a5[] +
7+
Release: release:2024-04-22[] (`v0.3.1932`)
8+
9+
== New Features
10+
11+
* pr:16813[] add wrap/unwrap `#[cfg_attr]` assist.
12+
* pr:17094[] add "Convert `From` to `TryFrom`" assist.
13+
* pr:17110[] add minimal `cargo-script` support.
14+
* pr:17118[] allow `.rs` files to be used linkedProjects.
15+
* pr:16057[] render matched declarative macro arm on hover.
16+
17+
== Fixes
18+
19+
* pr:17115[] (first contribution) try to generate more meaningful names in JSON converter.
20+
* pr:16877[] fix `impl Trait<Self>` causing stack overflows.
21+
* pr:17055[] replace just the variable name in the "Unused variable" quick fix.
22+
* pr:17093[] avoid some circular symlinks in VFS.
23+
* pr:17024[] handle escaped chars in doc comments.
24+
* pr:17074[] add `static` and `const` highlight token types.
25+
* pr:17105[] make test harness arguments configurable.
26+
27+
== Internal Improvements
28+
29+
* pr:17104[] (first contribution) bump actions in `metrics.yaml`.
30+
* pr:16639[] redesign `rust-analyzer::config`.
31+
* pr:17078[] improve diagnostics performance.
32+
* pr:16726[] remove `#[cfg(test)]` hacks.
33+
* pr:17108[] clean up `#[cfg]` and environment handling in `project-model`.
34+
* pr:16938[] handle `BeginPanic` in const eval.
35+
* pr:17119[] extract common fields out of `ProjectWorkspace` variants.
36+
* pr:17037[] improve `TokenSet` implementation and add reserved keywords.
37+
* pr:17072[] use `hir_fmt_args` everywhere in `hir_ty::display`.
38+
* pr:17070[] remove unnecessay `GlobalState::send_hint_refresh_query` field.
39+
* pr:17087[] fix a few `tracing` spans without `.entered()`.
40+
* pr:17083[] improve `ReferenceCategoryType`.
41+
* pr:16257[] teach Cargo about `#[cfg(rust_analyzer)]`.
42+
* pr:17025[] use `josh` for subtree syncs.
43+
* pr:17095[] add a `CONTRIBUTING.md`.

0 commit comments

Comments
 (0)