Commit Graph

1152 Commits

Author SHA1 Message Date
bit-aloo
776dfd7abe remove make from move_bound 2026-03-06 15:32:33 +05:30
bit-aloo
52511b7cb6 remove make from generate_fn_type_alias_from_new 2026-03-06 15:32:33 +05:30
bit-aloo
a5b96fc81d remove make from convert_bool_to_enum 2026-03-06 15:32:33 +05:30
bit-aloo
6feab700fc remove make from add_turbo_fish 2026-03-06 15:32:33 +05:30
bit-aloo
2aeb269257 remove make from extract_type_alias 2026-03-06 15:32:33 +05:30
A4-Tacks
fea31a6f8b fix: Improve newline for make match, if, while etc
- Remove unused `ast::make::match_arm_with_guard`

Example
---
```rust
fn main() {
    if true {
        $0if true
            && false
        {
            foo()
        }
    }
}
```

**Before this PR**

```rust
fn main() {
    if true {
        match true
            && false {
            true => foo(),
            false => (),
        }
    }
}
```

**After this PR**

```rust
fn main() {
    if true {
        match true
            && false
        {
            true => foo(),
            false => (),
        }
    }
}
```
2026-02-27 19:39:12 +08:00
SpiZeak
dd8e886398 feat: migrate fix_visibility assist to SyntaxEditor 2026-02-27 08:19:56 +01:00
bit-aloo
f362b282f8 migrate covert_tuple_return_type to struct to syntax editor 2026-02-12 14:52:48 +05:30
bit-aloo
92baa0878d migrate destructure tuple binding to new syntaxEditor 2026-02-11 13:39:13 +05:30
bit-aloo
3093a75651 self_param and impl_ implementation in syntax_factory 2026-02-08 22:14:06 +05:30
Geoffry Song
a6d8875ee6 Implement homogeneous & heterogeneous try blocks 2026-02-02 18:13:10 -08:00
Geoffry Song
97770dc5d1 Parse try bikeshed T {} syntax 2026-02-02 18:13:10 -08:00
Abdul
1449bc850d refactor: Remove unused comments related to SyntaxErrorKind 2026-02-02 02:00:43 +05:30
A4-Tacks
8a0462acb5 Fix false positive precedence in (2 as i32) < 3
Example
---
```rust
fn f() { _ = $0(1 as u32) << 10; }
```

**Before this PR**

This is syntax error

```rust
fn f() { _ = 1 as u32 << 10; }
```

**After this PR**

Assist not applicable
2026-01-14 18:24:38 +08:00
bit-aloo
10c9c94b2c add make corresponding constructor methods in SyntaxFactory 2026-01-11 21:33:57 +05:30
Lukas Wirth
2538fdb5b9 Merge pull request #21415 from Veykril/push-qusurvyqwmxt
feat: Allow rust paths in symbol search
2026-01-10 11:01:15 +00:00
Lukas Wirth
c471c5c82e Cleanup 2026-01-10 11:45:49 +01:00
Wilfred Hughes
9c0d88cc07 internal: Include private definitions in generated rustdoc
rust-analyzer has handy prebuilt `cargo doc` output at
https://rust-lang.github.io/rust-analyzer/ide/

However, it doesn't include private definitions, which makes it less
useful when trying to learn unfamiliar parts of the codebase.

Instead, pass `--document-private-items` so the HTML includes
information on private types and modules too. rustdoc renders these
with a padlock icon, so it's still clear that they're private.

This change also exposes some more rustdoc warnings, which I've fixed.
2026-01-09 12:01:54 +00:00
Chayim Refael Friedman
76d44ffb3f Merge pull request #21375 from A4-Tacks/impl-trait-target-and-dyn-hint
Fix incorrect dyn hint in `impl Trait for`
2025-12-31 08:30:52 +00:00
A4-Tacks
526fed2faf Fix incorrect dyn hint in impl Trait for
Example
---
```rust
trait T {}
impl T for {}
```

**Before this PR**

```rust
trait T {}
impl T for {}
  // ^ dyn
```

**After this PR**

```rust
trait T {}
impl T for {}
```
2025-12-31 16:18:33 +08:00
Chayim Refael Friedman
b3fde4b2f1 Fix Clippy 2025-12-29 18:58:25 +02:00
Lukas Wirth
e04bec5075 perf: Reduce channel lock contention for drop-threads 2025-12-28 11:43:08 +01:00
Chayim Refael Friedman
75d2e9cd72 Fix parsing of format_args!("...", keyword=...) 2025-12-28 06:35:10 +02:00
Lukas Wirth
af45994feb Introduce cargo-machete ci step 2025-12-25 10:38:05 +01:00
Lukas Wirth
3aecf081f6 Merge pull request #20996 from A4-Tacks/explicit-dot-call-deref
Add ide-assist: add_explicit_method_call_deref
2025-12-21 13:50:43 +00:00
A4-Tacks
f0055f6557 Add parent_match method to node_ext 2025-12-21 12:54:47 +08:00
The rustc-josh-sync Cronjob Bot
2d06e40dd0 Merge ref '0208ee09be46' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 0208ee09be465f69005a7a12c28d5eccac7d5f34
Filtered ref: 69b2702db7
Upstream diff: dfe1b8c97b...0208ee09be

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-15 04:30:45 +00:00
Chayim Refael Friedman
459982c158 Fix a panic in ast::TypeBound::kind() 2025-12-12 00:45:37 +02:00
Jieyou Xu
acb575c6ab rust-analyzer: prep crates for testing against in-tree rustc_private 2025-12-11 20:22:49 +08:00
Shoyu Vanilla (Flint)
e8ac25242f Merge pull request #21044 from A4-Tacks/fix-make-unnamed-param
Fix make::unnamed_param result a untyped_param
2025-12-09 04:45:26 +00:00
Shoyu Vanilla (Flint)
a071c5cb04 Merge pull request #21174 from Young-Flash/migrate_convert_iter_for_each_to_for
internal: migrate `convert_iter_for_each_to_for` to SyntaxEditor api
2025-12-08 07:11:26 +00:00
Shoyu Vanilla (Flint)
3dfe74e02d Merge pull request #21199 from Young-Flash/migrate_generate_delegate_trait
internal: migrate `generate_delegate_trait` to SyntaxEditor api
2025-12-08 07:10:19 +00:00
Young-Flash
d5ea35572b minor: add missing SyntaxFactory::assoc_item_list 2025-12-05 20:27:30 +08:00
Young-Flash
1a5d1bf56d minor: fmt & clippy 2025-12-04 23:30:01 +08:00
Cheuk Yin Ng
beb694b977 fix(spelling): underling -> underlying 2025-12-01 23:21:18 -08:00
Young-Flash
80d511fcd8 internal: add missing method for SyntaxFactory 2025-12-01 22:05:24 +08:00
Chayim Refael Friedman
f0e372c3b6 Rewrite attribute handling
Basically, we switch to expanding cfg_attr in AST form, filter irrelevant attributes from the item tree, and move hir-def attributes (non-item-tree) to be flag-based.

The main motivation is memory usage, although this also simplifies the code, and fixes some bugs around handling of `cfg_attr`s.
2025-11-29 18:52:18 +02:00
Shoyu Vanilla (Flint)
3ee32218fe Merge pull request #21023 from A4-Tacks/syntax-editor-duplicate-changed
Fix syntax_editor duplicated changed element
2025-11-28 10:48:45 +00:00
Lukas Wirth
1ea2498b49 Merge pull request #20163 from ChayimFriedman2/parser-per-token-edition
fix: Use per-token, not global, edition in the parser
2025-11-28 08:11:38 +00:00
Young-Flash
4f4466302e internal: add missing method for SyntaxFactory 2025-11-25 22:37:48 +08:00
Shoyu Vanilla (Flint)
e540a446de Merge pull request #21090 from asuto15/fix/#21063
fix: Enhance remove_parentheses assist to handle return expressions
2025-11-23 04:42:55 +00:00
asuto15
14fa82bd8b fix: Enhance remove_parentheses assist to handle return expressions 2025-11-23 12:51:05 +09:00
Lukas Wirth
c16b39c131 analysis_stats: Record lang item queries, disable async drop in stats 2025-11-22 21:20:23 +01:00
Aditya-PS-05
b80ca3f35e fix: never remove parens from prefix ops with valueless return/break/continue 2025-11-20 04:01:14 +05:30
Lukas Wirth
a3910c6f14 syntax: Drop Parse on separate thread
Rowan's green nodes are super drop heavy and as lru eviction happens on cancellation this can block for quite some time, especially after cache priming
2025-11-17 11:19:43 +01:00
A4-Tacks
4fb242e4bf Fix make::unnamed_param result a untyped_param
- Add `make::untyped_param`
- Add some basic make tests

Example
---
```rust
make::unnamed_param(make::ty("Vec<T>")),

```

**Before this PR**

```text
PARAM@0..4
  IDENT_PAT@0..4
    NAME@0..4
      IDENT@0..4 "Vec"
```

**After this PR**

```text
PARAM@0..6
  PATH_TYPE@0..6
    PATH@0..6
      PATH_SEGMENT@0..6
        NAME_REF@0..3
          IDENT@0..3 "Vec"
        GENERIC_ARG_LIST@3..6
          L_ANGLE@3..4 "<"
          TYPE_ARG@4..5
            PATH_TYPE@4..5
              PATH@4..5
                PATH_SEGMENT@4..5
                  NAME_REF@4..5
                    IDENT@4..5 "T"
          R_ANGLE@5..6 ">"
```

---

Assist: `Generate a type alias for function with unnamed params`

```rust
fn foo$0(x: Vec<i32>) {}
```

**Before this PR**

```rust
type FooFn = fn(Vec);

fn foo(x: Vec<i32>) {}
```

**After this PR**

```rust
type FooFn = fn(Vec<i32>);

fn foo(x: Vec<i32>) {}
```
2025-11-16 17:34:54 +08:00
A4-Tacks
d48361b47b Fix syntax_editor duplicated changed tokens 2025-11-12 13:34:28 +08:00
A4-Tacks
b8bbebf4f0 Fix syntax_editor duplicated changed element
Example
---
```rust
let arg_list = make::arg_list([make::expr_literal("1").into(), make::expr_literal("2").into()]);
let mut editor = SyntaxEditor::new(arg_list.syntax().clone());
let target_expr = make::expr_literal("3").clone_for_update();

for arg in arg_list.args() {
    editor.replace(arg.syntax(), target_expr.syntax());
}

let edit = editor.finish();
let expect = expect![["(3, 3)"]];
expect.assert_eq(&edit.new_root.to_string());
```

**Before this PR**

```text
(, )3
```

**After this PR**

```text
(3, 3)
```
2025-11-11 18:52:40 +08:00
A4-Tacks
d53146a013 Add ide-assist: add_explicit_method_call_deref
Insert explicit method call reference and dereferences.

Example
---
```rust
struct Foo;
impl Foo { fn foo(&self) {} }
fn test() {
    Foo$0.$0foo();
}
```

->

```rust
struct Foo;
impl Foo { fn foo(&self) {} }
fn test() {
    (&Foo).foo();
}
```
2025-11-08 21:55:36 +08:00
A4-Tacks
8549afe4a6 Add ide-assist: convert_range_for_to_while
Convert for each range into while loop.

```rust
fn foo() {
    $0for i in 3..7 {
        foo(i);
    }
}
```
->
```rust
fn foo() {
    let mut i = 3;
    while i < 7 {
        foo(i);
        i += 1;
    }
}
```
2025-11-04 13:31:41 +08:00