Chayim Refael Friedman
d1288f6353
Migrate inference to next solver
2025-09-30 13:10:59 +03:00
Shoyu Vanilla (Flint)
a56e57752f
Merge pull request #20748 from A4-Tacks/migrate-arith-op-prec
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Migrate `replace_arith_op` assist to use `SyntaxEditor`
2025-09-26 09:05:59 +00:00
Shoyu Vanilla (Flint)
62809824ad
Merge pull request #20599 from A4-Tacks/bang-de-morgan
...
Add applicable on bang `!` for apply_demorgan
2025-09-26 08:58:07 +00:00
A4-Tacks
918d3b8175
Migrate replace_arith_op assist to use SyntaxEditor
2025-09-26 16:54:47 +08:00
Shoyu Vanilla (Flint)
6135c07683
Merge pull request #20611 from A4-Tacks/replace-arith-op-prec
...
Fix precedence parenthesis for replace_arith_op
2025-09-26 08:30:46 +00:00
Shoyu Vanilla (Flint)
e81202c919
Merge pull request #20731 from A4-Tacks/expand-rest-pat-in-tuple-slice-pat
...
Fix expand rest pattern in tuple and slice pattern
2025-09-26 06:54:30 +00:00
A4-Tacks
6d85fd739f
Fix expand rest pattern in tuple and slice pattern
...
Assist: expand_tuple_rest_pattern
Fills fields by replacing rest pattern in tuple patterns.
Example
---
```
fn foo(bar: (char, i32, i32)) {
let (ch, ..$0) = bar;
}
```
->
```
fn foo(bar: (char, i32, i32)) {
let (ch, _1, _2) = bar;
}
```
---
Assist: expand_slice_rest_pattern
Fills fields by replacing rest pattern in slice patterns.
Example
---
```
fn foo(bar: [i32; 3]) {
let [first, ..$0] = bar;
}
```
->
```
fn foo(bar: [i32; 3]) {
let [first, _1, _2] = bar;
}
```
2025-09-26 14:44:05 +08:00
Shoyu Vanilla (Flint)
997f3ec544
Merge pull request #20598 from A4-Tacks/let-chain-sup-conv-to-guarded-ret
...
Add let-chain support for convert_to_guarded_return
2025-09-26 06:42:10 +00:00
Shoyu Vanilla (Flint)
a96d92e9e9
Merge pull request #20736 from A4-Tacks/fix-invert-if-let-chain
...
Fix applicable on if-let-chain for invert_if
2025-09-26 05:36:52 +00:00
A4-Tacks
3964af7bf6
Add applicable in closure for convert_to_guarded_return
...
Example
---
```rust
fn main() {
let _f = || {
bar();
if$0 true {
foo();
// comment
bar();
}
}
}
```
->
```rust
fn main() {
let _f = || {
bar();
if false {
return;
}
foo();
// comment
bar();
}
}
```
2025-09-25 22:04:53 +08:00
A4-Tacks
4e3b6b38dd
Fix not applicable for if-expr in let-stmt
...
Example
---
```rust
fn main() {
let _x = loop {
if$0 let Ok(x) = Err(92) {
foo(x);
}
};
}
```
**Before**:
Assist not applicable
**After**:
```rust
fn main() {
let _x = loop {
let Ok(x) = Err(92) else { continue };
foo(x);
};
}
```
2025-09-25 22:00:56 +08:00
A4-Tacks
a98da9f795
Add let-chain support for convert_to_guarded_return
...
- And add early expression `None` in function `Option` return
Example
---
```rust
fn main() {
if$0 let Ok(x) = Err(92)
&& x < 30
&& let Some(y) = Some(8)
{
foo(x, y);
}
}
```
->
```rust
fn main() {
let Ok(x) = Err(92) else { return };
if x >= 30 {
return;
}
let Some(y) = Some(8) else { return };
foo(x, y);
}
```
2025-09-25 21:04:48 +08:00
A4-Tacks
39ef6c28eb
Fix applicable on if-let-chain for invert_if
...
Example
---
```rust
fn f() { i$0f x && let Some(_) = Some(1) { 1 } else { 0 } }
```
**Before this PR**:
```rust
fn f() { if !(x && let Some(_) = Some(1)) { 0 } else { 1 } }
```
**After this PR**:
Assist not applicable
2025-09-24 14:36:09 +08:00
Shoyu Vanilla (Flint)
905641f352
Merge pull request #20543 from sgasho/fix/19443_replace_match_with_if_let
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Fix "Replace match with if let" not to trigger when invalid transformations occur
2025-09-23 09:46:37 +00:00
Shoyu Vanilla (Flint)
f6cf3035c3
Merge pull request #20730 from A4-Tacks/migrate-expand-rest-pat
...
Migrate `expand_record_rest_pattern` assist to use `SyntaxEditor`
2025-09-23 07:05:22 +00:00
A4-Tacks
258776b63a
Migrate expand_record_rest_pattern assist to use SyntaxEditor
...
Because `add_field` uses `ted`
2025-09-23 12:14:14 +08:00
jackh726
7b9ad945ec
Make Field::ty return TypeNs
2025-09-23 00:04:56 +00:00
Shoyu Vanilla (Flint)
d05355db16
Merge pull request #20592 from A4-Tacks/add-braces-closure-in-match
...
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Fix closure in match not applicable for add_braces
2025-09-22 15:51:12 +00:00
Shoyu Vanilla (Flint)
d6e14cc457
Merge pull request #20722 from A4-Tacks/pull-assign-up-inner-if
...
Fix apply in inner if for pull_assignment_up
2025-09-22 15:31:10 +00:00
A4-Tacks
fef1ab5d71
Fix applicable on underscore for bind_unused_param
...
Fixes:
- applicable on underscore prefix parameter
- using binding mode as an expression
Examples
---
```rust
fn foo($0_x: i32, y: i32) {}
```
**Before this PR**:
```rust
fn foo(_x: i32, y: i32) {
let _ = _x;
}
```
**After this PR**:
Assist not applicable
---
```rust
fn foo(ref $0y: i32) {}
```
**Before this PR**:
```rust
fn foo(ref y: i32) {
let _ = ref y;
}
```
**After this PR**:
```rust
fn foo(ref y: i32) {
let _ = y;
}
```
2025-09-22 15:13:13 +08:00
A4-Tacks
23535a6646
Fix apply in internal if for pull_assignment_up
...
Example
---
```rust
fn foo() {
let mut a = 1;
if true {
a = 2;
} else if true {
$0a = 3;
} else {
a = 4;
}
}
```
**Before this PR**:
```rust
fn foo() {
let mut a = 1;
if true {
a = 2;
} else a = if true {
3
} else {
4
};
}
```
**After this PR**:
```rust
fn foo() {
let mut a = 1;
a = if true {
2
} else if true {
3
} else {
4
};
}
```
2025-09-22 14:32:46 +08:00
A4-Tacks
168ca55a99
Fix not applicable on trailing comma for remove_dbg
...
`remove_dbg` not applicable for whitespaces after trailing comma
Example
---
```rust
fn foo() {
dbg!(
bar(),
);
}
```
**Before this PR**:
Assist not applicable
**After this PR**:
```rust
fn foo() {
bar();
}
```
2025-09-21 11:05:10 +08:00
Shoyu Vanilla (Flint)
6d5bfaee6a
Merge pull request #20709 from A4-Tacks/destruct-panic-on-not-add-deref-and-paren
...
Fix panic `!self.data().mutable` for destructure_struct_binding
2025-09-20 12:41:21 +00:00
Shoyu Vanilla (Flint)
da47c3da45
Merge pull request #20686 from A4-Tacks/gen-default-not-apply-selected
...
Fix selected applicable generate_default_from_enum_variant
2025-09-20 12:40:50 +00:00
A4-Tacks
d6c66dff1d
Fix selected multi variants applicable generate_default_from_enum_variant
2025-09-20 20:29:02 +08:00
Shoyu Vanilla (Flint)
259a01d73d
Merge pull request #20688 from A4-Tacks/fix-applicable-after-l-curly-replace-is-method-with-if-let
...
Fix applicable after l_curly for replace_is_method_with_if_let_method
2025-09-20 12:06:18 +00:00
Shoyu Vanilla (Flint)
84bb4051bf
Merge pull request #20700 from A4-Tacks/extract-var-let-expr
...
Fix extract_variable on LetExpr
2025-09-20 11:59:20 +00:00
A4-Tacks
f34e9ca8d3
Fix panic !self.data().mutable for destructure_struct_binding
...
When the reference type does not require adding a dereference or parentheses, it will panic
Example
---
```rust
struct Foo { bar: i32, baz: i32 }
fn main() {
let $0foo = &Foo { bar: 1, baz: 2 };
let _ = &foo.bar;
}
```
**Before this PR**:
Panic:
```
assertion failed: !self.data().mutable
```
**After this PR**:
```rust
struct Foo { bar: i32, baz: i32 }
fn main() {
let Foo { bar, baz } = &Foo { bar: 1, baz: 2 };
let _ = bar;
}
```
2025-09-20 17:52:01 +08:00
A4-Tacks
d4731ad9e2
Fix panics on Foo{mut x} for destructure_struct_binding
...
Example
---
```rust
struct Foo { x: () }
struct Bar { foo: Foo }
fn f(Bar { mut $0foo }: Bar) {}
```
**Before this PR**:
Panic `Option::unwrap`
**After this PR**:
```rust
struct Foo { x: () }
struct Bar { foo: Foo }
fn f(Bar { foo: Foo { mut x } }: Bar) {}
```
2025-09-20 16:14:51 +08:00
Chayim Refael Friedman
b12a129347
Merge pull request #20701 from A4-Tacks/track-caller-assist-test
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Add `#[track_caller]` for check_assist_by_label
2025-09-19 15:07:17 +00:00
A4-Tacks
42bba767ef
Add #[track_caller] for check_assist_by_label
2025-09-19 13:39:45 +08:00
A4-Tacks
3610cb12f7
Fix extract_variable on LetExpr
...
Example
---
```rust
fn main() {
if $0let$0 Some(x) = Some(2+2) {}
}
```
**Before this PR**:
```rust
fn main() {
let $0var_name = let Some(x) = Some(2+2);
if var_name {}
}
```
**After this PR**:
```rust
fn main() {
let $0var_name = Some(2+2);
if let Some(x) = var_name {}
}
```
2025-09-19 13:35:34 +08:00
A4-Tacks
d3748517c9
Fix applicable after l_curly for replace_is_method_with_if_let_method
2025-09-18 20:00:31 +08:00
Chayim Refael Friedman
cd31e11f94
Merge pull request #20664 from ChayimFriedman2/coerce-ns
...
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Port a bunch of stuff from rustc and fix a bunch of type mismatches/diagnostics
2025-09-18 00:19:30 +00:00
Shoyu Vanilla (Flint)
2268a56350
Merge pull request #20682 from A4-Tacks/fix-change-vis-applicable-on-variant
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Fix applicable on variant field for change_visibility
2025-09-17 17:00:31 +00:00
A4-Tacks
5b5c50eec8
Fix applicable on variant field for change_visibility
...
Enum variant fields do not allow visibility
Example
---
```rust
enum Foo {
Variant($0String),
}
```
**Before this PR**:
```rust
enum Foo {
Variant(pub(crate) String),
}
```
**After this PR**:
Assist not applicable
2025-09-17 22:57:25 +08:00
Lukas Wirth
aecb756876
Merge pull request #20517 from Veykril/veykril/push-wrurmtqppzus
...
fix: Only compute unstable paths on nightly toolchains for IDE features
2025-09-16 07:28:47 +00:00
Lukas Wirth
685f156fa6
fix: Only compute unstable paths on nightly toolchains for IDE features
2025-09-16 09:17:16 +02:00
Chayim Refael Friedman
7d1860807e
Port a bunch of stuff from rustc and fix a bunch of type mismatches/diagnostics
...
This started from porting coercion, but ended with porting much more.
2025-09-15 18:56:17 +03:00
A4-Tacks
d0b95bd67f
Fix empty generic param list for generate_function
...
Example
---
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar()$0;
}
}
```
**Before this PR**:
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar();
}
fn bar<>(&self) ${0:-> _} {
todo!()
}
}
```
**After this PR**:
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar();
}
fn bar(&self) ${0:-> _} {
todo!()
}
}
```
2025-09-11 10:23:02 +08:00
A4-Tacks
7e2dc40642
Improve make::struct_ field_list whitespace
...
Example
---
**Before this PR**:
```rust
struct Variant{
field: u32
}
```
**After this PR**:
```rust
struct Variant {
field: u32
}
```
2025-09-07 22:19:52 +08:00
A4-Tacks
8f8ef0384b
Fix precedence parenthesis for replace_arith_op
...
Example
---
```rust
fn main() {
let x = 1*x $0+ 2;
}
```
**Before this PR**:
```rust
fn main() {
let x = 1*x.wrapping_add(2);
}
```
**After this PR**:
```rust
fn main() {
let x = (1*x).wrapping_add(2);
}
```
2025-09-05 06:30:28 +08:00
A4-Tacks
9edd2ad251
Add applicable on bang ! for apply_demorgan
...
Example
---
```rust
fn f() { $0!(1 || 3 && 4 || 5) }
```
->
```rust
fn f() { !1 && !(3 && 4) && !5 }
```
2025-09-03 21:14:19 +08:00
A4-Tacks
60153f6c52
Fix closure in match not applicable for add_braces
...
Example
---
**Not applicable**:
```rust
fn foo() {
match () {
() => {
t(|n|$0 n + 100);
}
}
}
```
2025-09-03 01:18:47 +08:00
sgasho
0e2bba1faa
fix: Prevent invalid transformation in 'Replace match with if let' assist
2025-08-27 00:06:47 +09:00
Shoyu Vanilla (Flint)
0358021a8f
Merge pull request #20534 from A4-Tacks/tog-macro-delim-semicolon
...
Fix ExprStmt delete semicolon for toggle_macro_delimiter
2025-08-26 05:55:08 +00:00
Shoyu Vanilla (Flint)
d86cf448c3
Merge pull request #20509 from A4-Tacks/fix-move-guard-to-arm-indent
...
Fix indent for move_guard_to_arm_body
2025-08-26 05:52:06 +00:00
Chayim Refael Friedman
870cb3329b
Merge pull request #20423 from ShoyuVanilla/import-2024
...
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Make import sorting order follow 2024 edition style
2025-08-25 19:19:31 +00:00
A4-Tacks
55b1ddbcc3
Fix ExprStmt delete semicolon for toggle_macro_delimiter
2025-08-25 16:45:12 +08:00
Chayim Refael Friedman
35369557a6
Merge pull request #20512 from A4-Tacks/arith-op-not-on-selected
...
replace_arith_op not applicable on selected
2025-08-24 00:17:09 +00:00