22995 Commits

Author SHA1 Message Date
Chayim Refael Friedman
71662e4c65
Merge pull request #20518 from A4-Tacks/fix-else-in-in-let
Fix `else` completion in `let _ = if x {} $0`
2025-08-23 22:07:13 +00:00
Chayim Refael Friedman
413ed5a361
Merge pull request #20511 from A4-Tacks/fix-conv-int-lit-on-selected
convert_integer_literal not on selected
2025-08-23 22:03:17 +00:00
A4-Tacks
3e48de3905
Fix else completion in let _ = if x {} $0 2025-08-23 17:48:30 +08:00
A4-Tacks
6a7a0fac95
Add let in let-chain completion support
Example
---
```rust
fn f() {
    if true && $0 {}
}
```
->
```rust
fn f() {
    if true && let $1 = $0 {}
}
```
2025-08-22 21:58:49 +08:00
A4-Tacks
5f8cfeb3f4
fix: convert_integer_literal not on selected
`convert_integer_literal` can only convert the first literal,
it is not reasonable to apply it when selected

Example
---

```rust
fn main() {
    $01+1$0;
}
```

**Assist old outputs**:

```
Convert 1 to 0b1
Convert 1 to 0o1
Convert 1 to 0x1
Replace arithmetic with call to checked_*
Replace arithmetic with call to saturating_*
Replace arithmetic with call to wrapping_*
Extract into variable
Extract into constant
Extract into static
Extract into function
```

**Assist this PR outputs**:

```
Replace arithmetic with call to checked_*
Replace arithmetic with call to saturating_*
Replace arithmetic with call to wrapping_*
Extract into variable
Extract into constant
Extract into static
Extract into function
```
2025-08-22 17:13:30 +08:00
Lukas Wirth
0914f78f23 Fix panic in syntax_highlighting 2025-08-22 09:00:25 +02:00
A4-Tacks
f5f797e2d3
Fix indent for move_guard_to_arm_body
Input:

```rust
fn main() {
    match 92 {
        x $0if true
            && true
            && true =>
        {
            {
                false
            }
        },
        _ => true
    }
}
```

Old output:

```rust
fn main() {
    match 92 {
        x =>
        if true
                    && true
                    && true {
            {
                    {
                        false
                    }
                }
        },
        _ => true
    };
}
```

This PR fixed:

```rust
fn main() {
    match 92 {
        x => if true
            && true
            && true {
            {
                {
                    false
                }
            }
        },
        _ => true
    }
}
```
2025-08-22 11:43:03 +08:00
Chayim Refael Friedman
14872a5332
Merge pull request #20504 from ShoyuVanilla/ethereum-madness
fix: Infinite recursion while lowering assoc type bounds from supertraits
2025-08-21 20:45:29 +00:00
Shoyu Vanilla
80ce520660 fix: Infinite recursion while lowering assoc type bounds from supertraits 2025-08-22 05:24:33 +09:00
Chayim Refael Friedman
df375b0855 Remove unnecessary salsa::attach() calls 2025-08-21 22:40:58 +03:00
Chayim Refael Friedman
7a27a27f4b Attach the DB when mapping the result of world_symbols()
We call `try_to_nav()` there.
2025-08-21 08:06:43 +03:00
Chayim Refael Friedman
243d158e88 Attach the DB in symbol queries 2025-08-21 07:14:55 +03:00
lcnr
1d4f709e60 user facing code should use not use PostAnalysis 2025-08-19 08:24:34 +02:00
Lukas Wirth
aed0fec1a9 Auto-attach database in Analysis calls 2025-08-18 09:52:23 +02:00
Shoyu Vanilla (Flint)
becf04b67a
Merge pull request #20442 from ChayimFriedman2/unqualify
fix: Only import the item in "Unqualify method call" if needed
2025-08-18 06:24:35 +00:00
jackh726
596a6bf6be Remove fixme comment 2025-08-17 16:04:50 +00:00
jackh726
3ceaf806f6 Add FIXME in named_associated_type_shorthand_candidates 2025-08-17 16:04:50 +00:00
jackh726
33cc8609dc Add fixme to associated_ty_item_bounds 2025-08-17 16:04:50 +00:00
jackh726
ec26d9f48a Update fixme 2025-08-17 16:04:50 +00:00
jackh726
cdf51f28f4 Add new_empty_tuple 2025-08-17 16:04:50 +00:00
jackh726
84388ceb0e Remove a bunch of stuff from chalk_db 2025-08-17 16:04:50 +00:00
jackh726
766e6b58ad Use impl_trait_ns in Impl::trait_ref 2025-08-17 16:04:50 +00:00
jackh726
e979349978 Switch TraitRef in hir::TraitRef to next solver 2025-08-17 16:04:50 +00:00
jackh726
7f0ec8b69f Replace layout_of_ty with layout_of_ty_ns 2025-08-17 16:04:50 +00:00
jackh726
da6fbda16c Remove all_super_traits in dyn_compatibility 2025-08-17 16:04:50 +00:00
jackh726
a66ba475bf Switch generics_require_sized_self to next solver 2025-08-17 16:04:50 +00:00
jackh726
74a9d17920 Convert more of dyn_compatibility to next-solver 2025-08-17 16:04:50 +00:00
jackh726
f9d2d2dd87 Switch associated_type_shorthand_candidates to lower_nextsolver 2025-08-17 16:04:50 +00:00
jackh726
496f5f9e96 Cleanup assoc_type_shorthand_candidates 2025-08-17 16:04:50 +00:00
jackh726
aa890b49ff Change direct_super_traits to use generic_predicates_for_param_ns 2025-08-17 16:04:50 +00:00
jackh726
17b94c41b1 Convert some of mir/eval to next-solver types 2025-08-17 16:04:50 +00:00
jackh726
9912b803bc Deduplicate layout_of_adt 2025-08-17 16:04:50 +00:00
jackh726
eeaefa4b9d impl HirDisplay for next_solver::Ty 2025-08-17 16:04:49 +00:00
jackh726
b2f107cb8b Convert more of dyn_compatibility to next-solver 2025-08-17 16:02:59 +00:00
jackh726
8228f6f9f7 Convert some of dyn_compatibility to next-solver and remove generic_predicates_without_parent_query 2025-08-17 16:02:59 +00:00
Shoyu Vanilla
15ac6a21dd fix: Make lang items query properly filter out overwritten/excluded sysroots 2025-08-17 22:28:04 +09:00
Kirill Bulatov
11917cd270 Use a more specific error message when talking about the server logs 2025-08-15 20:15:21 +03:00
jackh726
651ec4b08b add comment 2025-08-15 05:04:41 +00:00
jackh726
c3cad7d3f4 Add test for webrender-2022 metrics 2025-08-15 05:03:44 +00:00
Lukas Wirth
03a6465d2e
Merge pull request #20453 from jackh726/nts-part2
Fix webrender-2022 metrics - shift vars when mapping dyn
2025-08-14 21:27:42 +00:00
Ralf Anton Beier
e7c3fe1978
feat: hint at unterminated strings in unknown prefix errors
When encountering 'unknown literal prefix' errors, check for unbalanced
quotes in recent code and suggest checking for unterminated string literals.
2025-08-14 19:30:29 +02:00
Lukas Wirth
e87a2fcff2 Track diagnostic generations per package 2025-08-14 14:33:50 +02:00
Shoyu Vanilla (Flint)
4d7b9044c3
Merge pull request #20455 from A4-Tacks/fix-indent-conv-match-to-let-else
Fix indent for convert_match_to_let_else
2025-08-14 08:23:48 +00:00
Shoyu Vanilla (Flint)
83b852353a
Merge pull request #20456 from A4-Tacks/match-with-if-let-guard
Add guard to let-chain for replace_match_with_if_let
2025-08-14 08:22:05 +00:00
A4-Tacks
8399a88e99
Add guard to let-chain for replace_match_with_if_let
```rust
fn main() {
    match$0 Some(0) {
        Some(n) if n % 2 == 0 && n != 6 => (),
        _ => code(),
    }
}
```
->
```rust
fn main() {
    if let Some(n) = Some(0) && n % 2 == 0 && n != 6 {
        ()
    } else {
        code()
    }
}
2025-08-14 10:07:25 +08:00
A4-Tacks
e797f81f2a
Fix indent for convert_match_to_let_else
Example
---
```
//- minicore: option
fn f() {
    let x$0 = match Some(()) {
        Some(it) => it,
        None => {//comment
            println!("nope");
            return
        },
    };
}
```

**Old output**:

```rust
fn f() {
    let Some(x) = Some(()) else {//comment
            println!("nope");
            return
        };
}
```

**This PR output**:

```rust
fn f() {
    let Some(x) = Some(()) else {//comment
        println!("nope");
        return
    };
}
```
2025-08-14 08:34:31 +08:00
jackh726
fb53fdc1e4 Shift vars when mapping Dyn 2025-08-13 19:50:15 +00:00
Chayim Refael Friedman
b06ce60086
Merge pull request #20390 from A4-Tacks/if-else-comp-in-args-or-let
Add if..else completions in LetStmt and ArgList
2025-08-13 16:44:39 +00:00
Lukas Wirth
7af2dd9704
Merge pull request #20446 from lcnr/kinda-unhelpful-3
next-solver fun time
2025-08-13 10:17:53 +00:00
lcnr
164d42ceab manually normalize alias 2025-08-13 11:00:00 +02:00