Commit Graph

320681 Commits

Author SHA1 Message Date
Chayim Refael Friedman 3d3302cdac Merge pull request #20625 from A4-Tacks/multi-attr-to-cfg_attr
Add wrap multiple attr for wrap_unwrap_cfg_attr
2026-03-20 11:14:03 +00:00
Chayim Refael Friedman f17bfdaf21 Merge pull request #21768 from A4-Tacks/complete-fully-param-qualifier
fix: add ident_pat qualifier to fully fn param
2026-03-20 11:07:37 +00:00
A4-Tacks 69a0120580 Merge pull request #20407 from A4-Tacks/remove-doc-for-gen-trait
Remove doc comments for generate_trait_from_impl
2026-03-20 11:07:01 +00:00
A4-Tacks ca1fc35595 Remove doc comments for generate_trait_from_impl
**Input**:

```rust
struct Foo(f64);

impl F$0oo {
    /// Add `x`
    ///
    /// # Examples
    fn add(&mut self, x: f64) {
        self.0 += x;
    }
}
```

**This PR**:

```rust
struct Foo(f64);

trait NewTrait {
    /// Add `x`
    ///
    /// # Examples
    fn add(&mut self, x: f64);
}

impl NewTrait for Foo {
    fn add(&mut self, x: f64) {
        self.0 += x;
    }
}
```

**Old**:

```rust
struct Foo(f64);

trait NewTrait {
    /// Add `x`
    ///
    /// # Examples
    fn add(&mut self, x: f64);
}

impl NewTrait for Foo {
    /// Add `x`
    ///
    /// # Examples
    fn add(&mut self, x: f64) {
        self.0 += x;
    }
}
```
2026-03-20 18:57:42 +08:00
Chayim Refael Friedman 4c93d12f33 Merge pull request #20600 from A4-Tacks/unwrap-tuple-on-let-expr
Add applicable on LetExpr for unwrap_tuple
2026-03-20 10:52:59 +00:00
Chayim Refael Friedman 7e6a279eb6 Merge pull request #20594 from A4-Tacks/conv-clos-to-fn-indent
Fix indent for convert_closure_to_fn
2026-03-20 10:42:35 +00:00
Chayim Refael Friedman fbb8d2d84b Merge pull request #20566 from A4-Tacks/part-selection-merge-uses
Add partial selection for merge_imports
2026-03-20 10:41:24 +00:00
Chayim Refael Friedman 378fcb3a06 Merge pull request #21787 from A4-Tacks/replace-is-some-and-fallback
Fix other predicate for replace_is_method_with_if_let_method
2026-03-20 06:55:39 +00:00
Chayim Refael Friedman b015909037 Merge pull request #21756 from A4-Tacks/fallback-let-closure
feat: complete block .let in closure expression
2026-03-20 06:35:48 +00:00
Chayim Refael Friedman b161e51ad9 Merge pull request #20614 from A4-Tacks/diag-not-apply-empty-struct-no-such-field
Fix not applicable on empty struct for no_such_field
2026-03-20 06:28:14 +00:00
Chayim Refael Friedman 4a18159d4a Merge pull request #21775 from A4-Tacks/inline-let-expr
feat: offer on let-expr for inline_local_variable
2026-03-20 06:22:58 +00:00
Chayim Refael Friedman 03ea35247f Merge pull request #21779 from Albab-Hasan/fix/next-solver-ir-print
fix: replace TODO placeholders in next-solver IrPrint with proper formatting
2026-03-20 06:05:07 +00:00
Chayim Refael Friedman fb84963508 Merge pull request #21848 from Shourya742/2026-03-20-remove-mapping-expr-underscore
Remove the mapping for `expr_underscore` from the syntax factory constructor
2026-03-20 05:33:23 +00:00
Chayim Refael Friedman 09197c90ea Merge pull request #21839 from A4-Tacks/dedup-comp-postfix-let-semi
fix: .let no complete semicolon before semicolon
2026-03-20 05:31:43 +00:00
bit-aloo eabc0199be remove mapping for expr underscore in syntax factory constructor 2026-03-20 10:47:54 +05:30
Chayim Refael Friedman e5c44d033b Merge pull request #21843 from sengmonkham/gsoc/migrate-convert-from-to-tryfrom-syntax-editor
Migrate convert_from_to_tryfrom assist to SyntaxEditor API
2026-03-20 02:58:57 +00:00
Chayim Refael Friedman 3e35ce4a41 Merge pull request #21845 from ada4a/push-yoxkrkvpupkl
remove outdated TODO
2026-03-19 18:54:46 +00:00
Ada Alakbarova 191969d3ea remove outdated TODO
we decided not to implement this after all
2026-03-19 19:40:34 +01:00
kawkoi b0d4f7a9ae Migrate convert_from_to_tryfrom assist to SyntaxEditor API
Replace mutable syntax tree editing (clone_for_update + make::) with
the SyntaxFactory API, which is the preferred approach for avoiding
mutable tree operations.

Changes:
- Use SyntaxFactory::with_mappings() instead of bare make:: constructors
- Replace make::ty() + .clone_for_update() with make.ty()
- Replace make::name() + .clone_for_update() with make.name()
- Replace make::ty_alias() + .clone_for_update() with make.ty_alias()
- Update wrap_ok() helper to accept &SyntaxFactory and use make.expr_call/arg_list/expr_path
- Add editor.add_mappings(make.finish_with_mappings()) to register mappings
2026-03-19 12:16:24 +05:30
A4-Tacks 9d9f68f527 fix: .let no complete semicolon before semicolon
Make `.let` `.letm` `.return` `.break` not duplicate semicolons

Example
---
```rust
fn main() {
    baz.l$0;
}
```

**Before this PR**

```rust
fn main() {
    let $0 = baz;;
}
```

**After this PR**

```rust
fn main() {
    let $0 = baz;
}
```
2026-03-18 19:56:58 +08:00
Laurențiu Nicola be963fba7f Merge pull request #21796 from Wilfred/codecov_badge
internal: Add codecov badge
2026-03-17 19:20:26 +00:00
Wilfred Hughes 7c93774f8d internal: Add codecov badge
It's tricky to find the relevant codecov page, so add a badge to the
readme showing coverage and linking to the codecov dashboard.
2026-03-17 16:04:11 +00:00
A4-Tacks 1cd4c2a0f7 Merge pull request #21826 from Shourya742/2026-02-03-migrate-utils-to-new-syntax-editor
Replace make usage with SyntaxFactory in few ide-assists utils methods
2026-03-16 21:52:43 +00:00
Laurențiu Nicola 607d64a04e Merge pull request #21829 from ada4a/push-zwprmlkyptmx
Small clean-ups
2026-03-16 20:32:09 +00:00
Ada Alakbarova 60207debab small clean-up
- extract unrelated `if` out of `matches!`
- in `include_references`:
  - add docs
  - use a while-let chain
  - add a more complex test
2026-03-16 21:22:07 +01:00
Chayim Refael Friedman f9269291f4 Merge pull request #21828 from Wilfred/parallel_prime_caches_scip
fix: SCIP generation should prime caches in parallel
2026-03-16 19:19:29 +00:00
bit-aloo 5fe6600b00 add mappings for constructors 2026-03-16 19:32:27 +05:30
Wilfred Hughes b7bc96291e fix: SCIP generation should prime caches in parallel
Previously load_workspace_into_db() called parallel_prime_caches()
with a worker count of 1 unconditionally. This made SCIP generation
slower than it needed to be.

Instead, pass the number of workers explicitly, and allow the SCIP
subcommand to specify the number of workers from the CLI, defaulting
to the number of physical CPUs.

On my M4 Macbook Pro this reduces the time taken to generate SCIP for
rust-analyzer from ~39 seconds to ~35 seconds.

AI disclosure: Partially written with Claude Opus 4.6.
2026-03-16 13:41:30 +00:00
Lukas Wirth 1b4821082f Merge pull request #21827 from ChayimFriedman2/multiprocess-slow-tests
Don't trigger GC on slow tests
2026-03-16 10:07:13 +00:00
Chayim Refael Friedman 637cc71c3b Don't trigger GC on slow tests
It can lead to UB.
2026-03-16 11:58:13 +02:00
A4-Tacks f01a047d1f Merge pull request #21784 from 80avin/fix-inline-type-assist
fix: remove angle brackets if all lifetime args removed in inline type alias code assist.
2026-03-16 09:23:25 +00:00
Laurențiu Nicola fc73d18c07 Merge pull request #21815 from rust-lang/dependabot/npm_and_yarn/editors/code/undici-6.24.1
Bump undici from 6.21.3 to 6.24.1 in /editors/code
2026-03-16 08:10:48 +00:00
bit-aloo f5836b5ab8 make insert_attribute accept syntaxFactory 2026-03-16 10:11:35 +05:30
bit-aloo 4e50d13d57 remove invert_boolean_expression_legacy 2026-03-16 10:07:35 +05:30
bit-aloo cc02838018 add syntaxFactory to tt_from_syntax and update corresponding handlers 2026-03-16 09:16:09 +05:30
bit-aloo f2bc624581 update convert_param_list_to_arg_list to get ArgList via make 2026-03-16 09:08:33 +05:30
bit-aloo d6b3207f27 convert_param_list_to_arg_list accept syntaxFactory and update the corresponding handlers 2026-03-16 09:06:44 +05:30
bit-aloo 7f3bc0b0a8 update wrap_block to accept SyntaxFactory and correspondingly update the handler which depends on it 2026-03-16 08:22:50 +05:30
bit-aloo 8dba85c487 update wrap_expr in utils ref_field_expr and update corresponding handler 2026-03-16 08:22:05 +05:30
Avinash Thakur 1bc2c44287 fix: remove empty angle brackets in inline type alias code assist.
fixes https://github.com/rust-lang/rust-analyzer/issues/21769
2026-03-16 01:27:31 +05:30
Shoyu Vanilla (Flint) 687b82e1e1 Merge pull request #21820 from ChayimFriedman2/type-as-trait-args-len
fix: Infer generic args for trait ref and its assoc type
2026-03-15 02:58:46 +00:00
Chayim Refael Friedman 491852c770 Infer generic args for trait ref and its assoc type
This was already there before the switch to the new solver, but it was reverted during the switch for some reason.
2026-03-14 20:22:14 +02:00
Lukas Wirth 3fca200a6d Merge pull request #21818 from Veykril/push-ystsymytyxkl
internal: Refactor `MirLowerCtx` to use `&ExpressionStore` instead of `&Body`
2026-03-14 16:23:35 +00:00
Lukas Wirth b2d9051502 internal: Refactor MirLowerCtx to use &ExpressionStore instead of &Body 2026-03-14 17:14:44 +01:00
dependabot[bot] 5e62d4f1c8 Bump undici from 6.21.3 to 6.24.1 in /editors/code
Bumps [undici](https://github.com/nodejs/undici) from 6.21.3 to 6.24.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.21.3...v6.24.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.24.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-14 11:10:56 +00:00
Chayim Refael Friedman 3a0572c2d6 Merge pull request #21804 from Wilfred/improve_proc_macro_srv_messages
fix: Clarify error messages when proc-macro-srv changes working directory
2026-03-12 14:36:23 +00:00
Wilfred Hughes 23c24d2bff fix: Clarify error messages when proc-macro-srv changes working directory
I'm investigating issues where users see a load of logs of the form:

```
Failed to set the current working dir to /redacted/path. Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
```

This is tricky to debug because there's two different code paths that
write exactly the same error message. Ensure they're unique.
2026-03-12 11:43:59 +00:00
Chayim Refael Friedman f6db3ef2e3 Merge pull request #21794 from Albab-Hasan/fix/union-naming-validation
fix: add naming convention validation for `union` types
2026-03-11 01:53:21 +00:00
Lukas Wirth f6a883d4e6 Merge pull request #21797 from ada4a/push-kmoyrzmylmqu
Remove outdated comment
2026-03-10 22:35:15 +00:00
Ada Alakbarova 32a35bcb42 Remove outdated comment 2026-03-10 19:12:12 +01:00