Commit graph

36369 commits

Author SHA1 Message Date
Lukas Wirth
7c810e9994
Merge pull request #20922 from Veykril/veykril/push-pznvunxxozkq
Some checks failed
autopublish / publish (push) Has been cancelled
release / dist (aarch64-apple-darwin) (push) Has been cancelled
release / dist (x86_64-apple-darwin) (push) Has been cancelled
release / dist (aarch64-unknown-linux-gnu) (push) Has been cancelled
release / dist (arm-unknown-linux-gnueabihf) (push) Has been cancelled
release / dist (x86_64-unknown-linux-gnu) (push) Has been cancelled
release / dist (aarch64-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-pc-windows-msvc) (push) Has been cancelled
release / dist (i686-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-unknown-linux-musl) (push) Has been cancelled
release / publish (push) Has been cancelled
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 (webrender-2022) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
perf: Reduce `client_commands` allocations in proto conversion
2025-10-27 23:00:39 +00:00
Lukas Wirth
3e2e8a8771 perf: Reduce client_commands allocations in proto conversion 2025-10-27 23:48:20 +01:00
Chayim Refael Friedman
c8472a7d9c
Merge pull request #20921 from ChayimFriedman2/specialization-ns2
Avoid calling `specializes()` query on crates that do not define `#![feature(specialization)]`
2025-10-27 22:31:29 +00:00
Chayim Refael Friedman
727d2aae89 Avoid calling specializes() query on crates that do not define #![feature(specialization)]
To save memory.
2025-10-28 00:22:44 +02:00
Shoyu Vanilla (Flint)
311d22c774
Merge pull request #20919 from ChayimFriedman2/qualifier-many-flyimport
fix: Consider all matches for flyimport even when searched with a qualifier
2025-10-27 19:13:53 +00:00
Chayim Refael Friedman
4c709bad14 Consider all matches for flyimport even when searched with a qualifier 2025-10-27 19:26:27 +02:00
Chayim Refael Friedman
f7a13f0a41
Merge pull request #20369 from ChayimFriedman2/rename-self2
Some checks are pending
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
feat: When renaming `self` to other name, change callers method method call syntax to assoc fn syntax
2025-10-27 15:38:33 +00:00
Chayim Refael Friedman
9d038a94c2 When renaming self to other name, change callers method method call syntax to assoc fn syntax 2025-10-27 17:27:18 +02:00
Chayim Refael Friedman
049767e6fa
Merge pull request #20914 from ShoyuVanilla/next-solver-tests
Some checks failed
release / dist (aarch64-apple-darwin) (push) Has been cancelled
release / dist (aarch64-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-apple-darwin) (push) Has been cancelled
release / dist (aarch64-unknown-linux-gnu) (push) Has been cancelled
release / dist (arm-unknown-linux-gnueabihf) (push) Has been cancelled
release / dist (x86_64-unknown-linux-gnu) (push) Has been cancelled
release / dist (x86_64-pc-windows-msvc) (push) Has been cancelled
release / dist (i686-pc-windows-msvc) (push) Has been cancelled
autopublish / publish (push) Has been cancelled
release / dist (x86_64-unknown-linux-musl) (push) Has been cancelled
rustdoc / rustdoc (push) Has been cancelled
metrics / build_metrics (push) Has been cancelled
release / publish (push) Has been cancelled
metrics / other_metrics (webrender-2022) (push) Has been cancelled
metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
metrics / other_metrics (self) (push) Has been cancelled
metrics / generate_final_metrics (push) Has been cancelled
Add regression tests for some fixed `A-ty` issues
2025-10-26 17:41:19 +00:00
Shoyu Vanilla
c6e605388f Add regression tests for some fixed A-ty issues 2025-10-27 02:18:52 +09:00
Shoyu Vanilla (Flint)
803ab10db4
Merge pull request #20913 from A4-Tacks/if-let-chain-for-is-method-with-if-let
Fix not applicable on let-chain for replace_is_method_with_if_let_method
2025-10-26 14:48:02 +00:00
Lukas Wirth
b0b108c370
Merge pull request #20837 from osdyne/extension-configuration
Add an Extension Config API
2025-10-26 12:34:05 +00:00
Michael Gruenewald
291aa7a602 Don't add cargo to requiresServerReloadOpts 2025-10-26 13:22:52 +01:00
A4-Tacks
d2f97dd2eb
Fix not applicable on let-chain for replace_is_method_with_if_let_method
Example
---
```rust
fn main() {
    let x = Some(1);
    let cond = true;
    if cond && x.is_som$0e() {}
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn main() {
    let x = Some(1);
    let cond = true;
    if cond && let Some(${0:x1}) = x {}
}
```
2025-10-26 19:55:09 +08:00
Lukas Wirth
808c931714
Merge pull request #19918 from A4-Tacks/remove-else-branches
Some checks are pending
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 ide-assist: remove else branches
2025-10-26 08:35:08 +00:00
Lukas Wirth
a23b39372f
Merge pull request #20589 from A4-Tacks/extract-mod-not-in-impl
Fix extract multiple item in impl for extract_module
2025-10-26 08:25:00 +00:00
Lukas Wirth
036ab604da
Merge pull request #20712 from A4-Tacks/destruct-tuple-shorthand
Fix shorthand field pat for destructure_tuple_binding
2025-10-26 08:18:40 +00:00
Lukas Wirth
ea2c027419
Merge pull request #20705 from A4-Tacks/flip-range
Add ide-assist: flip_range_expr
2025-10-26 08:17:15 +00:00
Lukas Wirth
dcc9af4bd0
Merge pull request #20764 from A4-Tacks/fix-guarded-rhs-let-else
Fix let-expr in lhs for convert_to_guarded_return
2025-10-26 08:06:08 +00:00
Lukas Wirth
bb21f0be13
Merge pull request #20912 from A4-Tacks/left-side-in-cond
Fix not complete `let` before expr in condition
2025-10-26 07:19:04 +00:00
Chayim Refael Friedman
daf1cd953f
Merge pull request #20759 from A4-Tacks/strongly-typed-conv-to-guarded
Some checks are pending
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 untyped syntax tree ans casts for convert_to_guarded_return
2025-10-25 17:14:53 +00:00
A4-Tacks
1607d77a30
Fix not complete let before expr in condition
Example
---
```rust
fn f() {
    if $0foo.bar() {}
}
```

**Before this PR**

"let" not in completion list

**After this PR**

```rust
fn f() {
    if let $1 = $0foo.bar() {}
}
```
2025-10-25 15:24:37 +08:00
Shoyu Vanilla (Flint)
09bee253dd
Merge pull request #20911 from chenyukang/yukang-fix-never-panic
Some checks are pending
metrics / generate_final_metrics (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (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
Use tracing error when received compiler message for unknown package
2025-10-25 05:37:52 +00:00
A4-Tacks
ad37af4c6f
Fix untyped syntax tree ans casts for convert_to_guarded_return 2025-10-25 13:16:57 +08:00
yukang
76f9b4e36c Use tracing error when received compiler message for unknown package 2025-10-25 09:14:35 +08:00
Laurențiu Nicola
51236f7314
Merge pull request #20908 from dpaoliello/windowssys
Some checks are pending
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
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
minor: Bump dependencies to remove indirect dependencies on windows-sys 0.52 and 0.59
2025-10-24 16:20:49 +00:00
Daniel Paoliello
98f341eaa6 Bump dependencies to remove indirect dependencies on windows-sys 0.52 and 0.59 2025-10-24 09:09:37 -07:00
Laurențiu Nicola
405bfcbc0d
Merge pull request #20907 from lnicola/fix-typo
minor: Fix typo
2025-10-24 14:23:52 +00:00
Laurențiu Nicola
9fdeb4ebf6 Fix typo 2025-10-24 17:10:23 +03:00
Chayim Refael Friedman
3748c16d79
Merge pull request #20905 from ShoyuVanilla/array-inhabit
fix: Fix a bug on inhabitedness checks for arrays
2025-10-24 14:07:47 +00:00
Shoyu Vanilla (Flint)
b4de9df2cd
Merge pull request #20902 from krobelus/support-rustfmt-again
Fix rustfmt for files that use 2024-edition syntax
2025-10-24 13:38:40 +00:00
Shoyu Vanilla
71ddc8dced fix: Fix a bug on inhabitedness checks for arrays 2025-10-24 22:35:09 +09:00
Shoyu Vanilla (Flint)
6b89e4b6c0
Merge pull request #20895 from ChayimFriedman2/async-block-no-opaque
fix: Lower async block/closures correctly
2025-10-24 13:22:23 +00:00
Laurențiu Nicola
cd5e682e47
Merge pull request #20903 from A4-Tacks/update-doc-add-braces
minor: Update ide-assist docs for add_braces
2025-10-24 12:54:32 +00:00
Chayim Refael Friedman
5a9230b5c6
Merge pull request #20904 from ChayimFriedman2/ns3
minor: Remove no-longer-necessary conversion
2025-10-24 11:19:10 +00:00
Chayim Refael Friedman
4987fc63aa Remove no-longer-necessary conversion 2025-10-24 14:08:01 +03:00
A4-Tacks
5d2eaeea54
minor: Update ide-assist docs for add_braces 2025-10-24 18:18:57 +08:00
Chayim Refael Friedman
01cacbeb83
Merge pull request #20899 from A4-Tacks/ide-comp-test-track
Some checks are pending
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
minor: fix track_caller for ide-complpetion test utils
2025-10-24 05:44:37 +00:00
A4-Tacks
943eba5668
minor: fix track_caller for ide-complpetion test utils 2025-10-24 13:34:39 +08:00
Shoyu Vanilla (Flint)
30cd10aca2
Merge pull request #20658 from A4-Tacks/more-expr-else-after-if
Fix else completion for more expressions
2025-10-24 04:27:41 +00:00
Shoyu Vanilla (Flint)
5844df084e
Merge pull request #20893 from ChayimFriedman2/specialization-ns
fix: Implement `Interner::impl_specializes()`
2025-10-24 04:23:11 +00:00
A4-Tacks
b96babeef1
Support else completion for more expressions
- Support else completion in ArrayExpr, ReturnExpr and PrefixExpr etc
- Support else completion after MatchArm expression

Before this PR, the else branch could not be completed in most expressions

Example
---
```rust
fn foo() -> [i32; 1] {
    [if true {
        2
    } $0]
}
```
->
```rust
fn foo() -> [i32; 1] {
    [if true {
        2
    } else {
        $0
    }]
}
```

---

```rust
fn foo() -> i32 {
    match () {
        () => if true {
            2
        } $0
    }
}
```
->
```rust
fn foo() -> i32 {
    match () {
        () => if true {
            2
        } else {
            $0
        }
    }
}
```
2025-10-24 10:06:06 +08:00
Shoyu Vanilla (Flint)
72af6f5fd8
Merge pull request #20844 from A4-Tacks/add-braces-assignment
Add applicable on assignment for add_braces
2025-10-24 01:53:21 +00:00
Chayim Refael Friedman
4a5f926466 Lower async closures to TyKind::CoroutineClosure
Instead of `TyKind::Closure`.

Note: the same `InternedCoroutineId` is used both for the *async closure* as well as for the *async block it returns*. When used in `TyKind::CoroutineClosure`, it represents the closure. When used in `TyKind::Coroutine`, it represents the async block. The generic args are different, though.

Also noteworthy is that we distinguish between the different kinds of coroutines (general coroutines, async coroutines and eventually gen coroutines too) via the expression producing them (stored in the `InternedCoroutineId`). It might be worth it to introduce a `CoroutineKind` field to `InternedCoroutineId`, although this is not done in this PR.
2025-10-24 04:31:56 +03:00
Chayim Refael Friedman
dfaf6ac5fa Represent async blocks as TyKind::Coroutine, not as opaques 2025-10-24 04:31:53 +03:00
Chayim Refael Friedman
9061bd3e81
Merge pull request #20896 from smmalis37/delete-mapping
Some checks are pending
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
Remove hir-ty/src/next_solver/mapping.rs
2025-10-24 00:13:13 +00:00
Steven Malis
70c0e8a652 Remove hir-ty/src/next_solver/mapping.rs 2025-10-23 19:18:18 -04:00
Johannes Altmanninger
70f972c2fd Fix rustfmt for files that use 2024-edition syntax
"cargo fmt" works fine but "rustfmt" fails to format some files.

	$ rustfmt crates/ide-db/src/search.rs
	error: let chains are only allowed in Rust 2024 or later
	   --> /home/johannes/git/rust-analyzer/crates/ide-db/src/search.rs:298:12
	    |
	298 |         if let &Definition::Module(module) = self
	    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I guess I could work around this by setting my format command to
"cargo fmt -- $filename" instead of "rustfmt $filename".

But it'd be nice if this worked OOTB. Make it so by adding specifying
the edition in rustfmt.toml.  We already have several other places
specifying the edition.

changelog internal
2025-10-23 23:13:13 +02:00
A4-Tacks
8d72c3dd9e
Add applicable on assignment for add_braces
```rust
fn foo() {
    let x =$0 n + 100;
}
```
->
```rust
fn foo() {
    let x = {
        n + 100
    };
}
```
2025-10-24 03:59:09 +08:00
Chayim Refael Friedman
bdd7f15b3d Implement Interner::impl_specializes()
Using specialization logic ported from rustc.
2025-10-23 20:48:51 +03:00