Commit graph

593 commits

Author SHA1 Message Date
Shoyu Vanilla (Flint)
084c1e537d
Merge pull request #20604 from A4-Tacks/cfg-attr-comp
Add cfg_attr predicate completion
2025-09-26 08:10:25 +00:00
Shoyu Vanilla (Flint)
a55e2b578c
Merge pull request #20729 from A4-Tacks/const-param-kwd
Add const parameter keyword completion
2025-09-26 07:00:52 +00:00
jackh726
6a458880fd Remove non-ns version of impl_self_ty and impl_trait 2025-09-24 05:45:12 +00:00
Jack Huey
cc7c061e34 Use lower_nextsolver::callable_item_signature instead of lower::callable_item_signature 2025-09-23 16:26:46 -04:00
A4-Tacks
b39c7a892f
Add const parameter keyword completion
Example
---
```rust
fn foo<c$0>() {}
```
->
```rust
fn foo<const $1: $0>() {}
```
2025-09-23 11:26:52 +08:00
Jack Huey
34f773f596 Use ParamEnv in TraitEnvironment 2025-09-23 00:04:57 +00:00
jackh726
7b9ad945ec Make Field::ty return TypeNs 2025-09-23 00:04:56 +00:00
Shoyu Vanilla (Flint)
c1499a2381
Merge pull request #20679 from A4-Tacks/no-comp-ty-in-nested-pat
Fix complete type in nested pattern
2025-09-22 15:37:39 +00:00
A4-Tacks
07f33e2b81
Fix IfExpr then branch suggest
- And add logic operation suggest

Example
---
In the old implementation, it always suggested conditions,
this is a lot of noise, e.g `contract_checks()~(use std::intrinsics::contract_checks) const fn() -> bool`

```rust
fn foo() {
    if true {
        c$0
    }
}
```
2025-09-20 20:56:27 +08:00
Shoyu Vanilla (Flint)
a943034d68
Merge pull request #20702 from A4-Tacks/else-not-before-else
Fix `else` completion before else keyword
2025-09-20 11:57:07 +00:00
A4-Tacks
c976f9900d
Fix else completion before else keyword
Example
---
```rust
fn foo() {
    let x = if true {
        1
    } el$0 else {
        2
    };
}
```

**Before this PR**:

```text
else~    k [LS]
else if~ k [LS]
```

**After this PR**:

```text
else if~ k [LS]
```
2025-09-19 19:59:47 +08:00
Chayim Refael Friedman
cd31e11f94
Merge pull request #20664 from ChayimFriedman2/coerce-ns
Some checks are pending
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
A4-Tacks
408b8bcc4a
Fix complete type in nested pattern
Example
---
```rust
struct Foo { num: u32 }
struct Bar(Foo);
fn foo(Bar($0)) {}
```

**Before this PR**:

```rust
struct Foo { num: u32 }
struct Bar(Foo);
fn foo(Bar(Foo { num$1 }: Foo$0)) {}
```

**After this PR**:

```rust
struct Foo { num: u32 }
struct Bar(Foo);
fn foo(Bar(Foo { num$1 }$0)) {}
```
2025-09-17 15:11:22 +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
d42c81e8d1
Fix extra semicolon before else in let-stmt
Example
---
```rust
fn main() {
    let x = if true {
        ()
    } $0 else {};
}
```

**Before this PR**:

```rust
fn main() {
    let x = if true {
        ()
    } else if $1 {
        $0
    }; else {};
}
```

**After this PR**:

```rust
fn main() {
    let x = if true {
        ()
    } else if $1 {
        $0
    } else {};
}
```
2025-09-12 20:56:59 +08:00
Shoyu Vanilla
4a8bc8db38 Fix failing tests and fill-in missing details 2025-09-10 01:43:22 +09:00
Laurențiu Nicola
a91fb2b9a1
Merge pull request #20620 from A4-Tacks/let-else-completion
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: add `else` keyword completion after `let` statements
2025-09-08 06:03:00 +00:00
A4-Tacks
56114fc302
Add allow else keyword completion in LetStmt
Example
---
```rust
fn foo() {
    let _ = 2 el$0
}
```
->
```rust
fn foo() {
    let _ = 2 else {
        $0
    };
}
```
2025-09-06 13:09:07 +08:00
A4-Tacks
b7a2f21d58
Add cfg_attr predicate completion
Example
---
```rust
#[cfg_attr($0, must_use)]
struct Foo;
```
2025-09-04 15:04:29 +08:00
Chayim Refael Friedman
8a2e845e58 Deduplicate methods in completion by function ID and not by name
Because duplicates can be found with traits. Worse, the inherent methods could be private, and we'll discover that only later. But even if they're not they're different methods, and its seems worthy to present them all to the user.
2025-09-02 08:16:36 +03:00
Chayim Refael Friedman
870cb3329b
Merge pull request #20423 from ShoyuVanilla/import-2024
Some checks are pending
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
Chayim Refael Friedman
05b7cbc236
Merge pull request #20507 from A4-Tacks/suggest-return-expr
Some checks are pending
metrics / other_metrics (self) (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 (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Add ReturnExpr completion suggest
2025-08-24 00:46:49 +00:00
A4-Tacks
ac7615b2a3
Add ReturnExpr completion suggest 2025-08-24 08:26:25 +08:00
Chayim Refael Friedman
544ef84898
Merge pull request #20513 from A4-Tacks/let-in-let-chain
Add let in let-chain completion support
2025-08-23 22:17:27 +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
Lukas Wirth
aed0fec1a9 Auto-attach database in Analysis calls 2025-08-18 09:52:23 +02:00
jackh726
496f5f9e96 Cleanup assoc_type_shorthand_candidates 2025-08-17 16:04:50 +00:00
jackh726
eeaefa4b9d impl HirDisplay for next_solver::Ty 2025-08-17 16:04:49 +00:00
Chayim Refael Friedman
b06ce60086
Merge pull request #20390 from A4-Tacks/if-else-comp-in-args-or-let
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 if..else completions in LetStmt and ArgList
2025-08-13 16:44:39 +00:00
Deadbeef
82f174fbd9 Merge Trait and TraitAlias handling 2025-08-13 15:28:08 +08:00
Shoyu Vanilla
635b536f11 Make import sorting order follow 2024 edition style 2025-08-12 00:01:46 +09:00
jackh726
9418a3f2df Implement next trait solver 2025-08-09 16:08:58 +00:00
Chayim Refael Friedman
bd08e2e480
Merge pull request #20381 from A4-Tacks/fix-assign-sug
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 assignment type analysis for ide-completion
2025-08-05 15:17:49 +00:00
A4-Tacks
bfbeddf32e
Change prev whitespace to prev trivia 2025-08-05 20:54:38 +08:00
A4-Tacks
5704431823
Add if..else completions in LetStmt and ArgList
Example
===
```rust
let x = $0;
```

Old completions:

```rust
let x = if $1 {
    $0
};
```

This PR current completions:

```rust
let x = if $1 {
    $2
} else {
    $0
};
```
2025-08-04 22:47:43 +08:00
A4-Tacks
22d6136462
Add assignment type analysis for ide-completion 2025-08-04 01:59:03 +08:00
Lukas Wirth
8ce30264c8 cargo clippy --fix 2025-07-31 10:55:10 +02:00
Hayashi Mikihiro
46e86c6aa2 Migrate PathTransform to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 13:26:39 +09:00
A4-Tacks
d001e27173
Fix assoc type where clause position 2025-07-12 23:48:41 +08:00
Chayim Refael Friedman
9c4a7705b1 Fix some things with builtin derives
1. Err on unions on derive where it's required.
 2. Err on `#[derive(Default)]` on enums without `#[default]` variant.
 3. Don't add where bounds `T: Default` when expanding `Default` on enums (structs need that, enums not).

Also, because I was annoyed by that, in minicore, add a way to filter on multiple flags in the line-filter (`// :`). This is required for the `Debug` and `Hash` derives, because the derive should be in the prelude but the trait not.
2025-07-03 23:05:56 +03:00
yukang
d8b424cb4c Remove unnecessary parens in closure 2025-06-29 19:28:48 +08:00
Chayim Refael Friedman
0b6df1716d Fix completion in when typing integer.|
It should show integer, not floating point methods.
2025-06-27 00:12:27 +03:00
Chayim Refael Friedman
4db8341ddb Prettify AST in PathTransform if it's coming from a macro 2025-06-26 10:03:44 +03:00
Lukas Wirth
b50d527931
Merge pull request #20036 from Veykril/push-yquvoyrxkksx
Do not default to 'static for trait object lifetimes
2025-06-24 06:59:54 +00:00
Lukas Wirth
2b05bd7d7e Do not default to 'static for trait object lifetimes
We lack trait object default lifetime elision, so `'static` can be wrong at times, confusing the user
2025-06-24 08:49:24 +02:00
Chayim Refael Friedman
de312d0c71 Don't run doctests 2025-06-23 00:50:22 +03:00
Shoyu Vanilla
4f8767d790 Minic rustc's new format_args! expansion 2025-06-22 13:22:28 +09:00