Commit graph

36297 commits

Author SHA1 Message Date
Shoyu Vanilla
a536262c8a Bump rustc deps 2025-10-23 08:40:18 +09:00
Chayim Refael Friedman
ec15d97710
Merge pull request #20887 from rust-lang/revert-20316-better-attrs
Revert "internal: Rewrite attribute handling"
2025-10-22 16:28:43 +00:00
Chayim Refael Friedman
7a7ab993bb
Revert "internal: Rewrite attribute handling" 2025-10-22 19:19:13 +03:00
Chayim Refael Friedman
08c0dc6234
Merge pull request #20316 from ChayimFriedman2/better-attrs
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
internal: Rewrite attribute handling
2025-10-22 12:46:19 +00:00
Lukas Wirth
cb09f2405d
Merge pull request #20886 from A4-Tacks/parse-missing-method-name
Improve parsing of missing name in MethodCallExpr
2025-10-22 10:30:55 +00:00
Chayim Refael Friedman
455ca02f17 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-10-22 11:47:01 +03:00
A4-Tacks
891391a6e5
Improve parsing of missing name in MethodCallExpr
Usually, this occurs when preparing to input a method name

However, once an identifier is entered, it is not reasonable for the parsing result to change from `CallExpr(FieldExpr())` to `MethodCallExpr()`

Example
---
```rust
fn foo() {
    x.
    ()
}
```

**Before this PR**:

```text
SOURCE_FILE
  FN
    FN_KW "fn"
    WHITESPACE " "
    NAME
      IDENT "foo"
    PARAM_LIST
      L_PAREN "("
      R_PAREN ")"
    WHITESPACE " "
    BLOCK_EXPR
      STMT_LIST
        L_CURLY "{"
        WHITESPACE "\n    "
        CALL_EXPR
          FIELD_EXPR
            PATH_EXPR
              PATH
                PATH_SEGMENT
                  NAME_REF
                    IDENT "x"
            DOT "."
          WHITESPACE "\n    "
          ARG_LIST
            L_PAREN "("
            R_PAREN ")"
        WHITESPACE "\n"
        R_CURLY "}"
  WHITESPACE "\n"
error 17: expected field name or number
```

**After this PR**:

```text
SOURCE_FILE
  FN
    FN_KW "fn"
    WHITESPACE " "
    NAME
      IDENT "foo"
    PARAM_LIST
      L_PAREN "("
      R_PAREN ")"
    WHITESPACE " "
    BLOCK_EXPR
      STMT_LIST
        L_CURLY "{"
        WHITESPACE "\n    "
        METHOD_CALL_EXPR
          PATH_EXPR
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "x"
          DOT "."
          WHITESPACE "\n    "
          ARG_LIST
            L_PAREN "("
            R_PAREN ")"
        WHITESPACE "\n"
        R_CURLY "}"
  WHITESPACE "\n"
error 17: expected method name, field name or number
```
2025-10-22 14:37:12 +08:00
Chayim Refael Friedman
9d8fa5da8f
Merge pull request #20571 from A4-Tacks/type-kw-comp
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
Add type keywords completions
2025-10-22 03:52:52 +00:00
Chayim Refael Friedman
d2c42fc647
Merge pull request #20831 from A4-Tacks/record-expr-shorthand
Add shorthand field completion for record-expr
2025-10-22 03:52:27 +00:00
A4-Tacks
e950c047aa
Add type keywords completions
Example
---
```
kw dyn
kw fn
kw for
kw impl
```
2025-10-22 11:35:09 +08:00
A4-Tacks
9a9f011382
Add shorthand field completion for record-expr
Example
---
```rust
struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Fo$0;
}
```

**Before this PR**:

```rust
struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Foo { bar: ${1:()}, n: ${2:()} }$0;
}
```

**After this PR**:

```rust
struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Foo { bar$1, n: ${2:()} }$0;
}
```
2025-10-22 11:31:43 +08:00
Chayim Refael Friedman
c585e67400
Merge pull request #20670 from A4-Tacks/heuristic-newline-in-block-expr
Add heuristic sensing `is_in_block`
2025-10-22 03:24:24 +00:00
A4-Tacks
4c14c52615
Add heuristic sensing is_in_block
Example
---
```rust
fn foo() -> [i32; 2] {
    l$0
    [0, n]
}
```

**Before this PR**:

```text
loop~
line!(…)~ macro_rules! line
```

**After this PR**:

```text
let~
loop~
letm~
line!(…)~ macro_rules! line
```
2025-10-22 11:14:31 +08:00
Chayim Refael Friedman
07fa633747
Merge pull request #20755 from A4-Tacks/doc-include
Add `doc = include_str!("…")` completion
2025-10-22 03:01:22 +00:00
Chayim Refael Friedman
9fd6be3662
Merge pull request #20771 from A4-Tacks/else-kw-invert-if
Add applicable on `else` for invert_if
2025-10-22 02:52:22 +00:00
Chayim Refael Friedman
39990a923c
Merge pull request #20882 from ChayimFriedman2/accurate-mem-report
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
internal: Clear next-solver cache before reporting memory usage in analysis-stats
2025-10-21 20:07:50 +00:00
Chayim Refael Friedman
a791d3b36d Clear next-solver cache before reporting memory usage in analysis-stats
The cache shouldn't be included, as it is mostly temporary (per-revision).
2025-10-21 22:58:31 +03:00
Chayim Refael Friedman
40cd34da04
Merge pull request #20554 from dpaoliello/extraenv
Improvements for resolving the value of the `env!` macro
2025-10-21 18:10:57 +00:00
Daniel Paoliello
554381f805 Allow env vars set in cargo.extraEnv to be resolved by the env! macro 2025-10-21 11:00:27 -07:00
Shoyu Vanilla (Flint)
57875bdce3
Merge pull request #20850 from A4-Tacks/add-mis-match-arms-indent
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
Migrate `add_missing_match_arms` assist, because edit_in_place uses ted
2025-10-21 05:00:12 +00:00
Shoyu Vanilla (Flint)
62eee18881
Merge pull request #20880 from A4-Tacks/conv-tuple-to-named-rest-pat
Fix invalid RestPat for convert_tuple_struct_to_named_struct
2025-10-21 04:59:16 +00:00
Shoyu Vanilla (Flint)
76ebe7d182
Merge pull request #20872 from A4-Tacks/conv-named-to-tuple-rest-pat
Fix missing RestPat for convert_named_struct_to_tuple_struct
2025-10-21 04:54:46 +00:00
A4-Tacks
ceb6903ffa
Fix invalid RestPat for convert_tuple_struct_to_named_struct
```rust
struct X$0(i8, i16, i32, i64);
fn foo(X(a, .., d): X) {}
```

**Before this PR**:

```rust
struct X { field1: i8, field2: i16, field3: i32, field4: i64 }
fn foo(X { field1: a, field2: .., field3: d }: X) {}
```

**After this PR**:

```rust
struct X { field1: i8, field2: i16, field3: i32, field4: i64 }
fn foo(X { field1: a, field4: d, .. }: X) {}
```
2025-10-21 11:52:06 +08:00
A4-Tacks
9fb0cd76f7
Add a FIXME for unordered fields 2025-10-21 11:27:50 +08:00
Chayim Refael Friedman
4a305f565a
Merge pull request #20878 from ChayimFriedman2/clippy-fix
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
minor: Fix beta warnings
2025-10-20 16:10:39 +00:00
Chayim Refael Friedman
ca6225ce1c Fix beta Clippy 2025-10-20 19:00:42 +03:00
Chayim Refael Friedman
3099a7f4d6
Merge pull request #20873 from ChayimFriedman2/to-ns2
Rip Chalk out of the codebase 🎉
2025-10-20 15:37:53 +00:00
Lukas Wirth
d0a54695be
Merge pull request #20876 from rust-lang/push-lznzsmuxzsot
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: Fix `signature_help` to proto conversion creating invalid utf16 offsets
2025-10-20 14:40:04 +00:00
Lukas Wirth
c367fb20f8 fix: Fix signature_help to proto conversion creating invalid utf16 offsets 2025-10-20 16:30:17 +02:00
Lukas Wirth
e78de709eb
Merge pull request #20854 from epage/frontmatter
feat(parser): Don't error on frontmatter
2025-10-20 08:58:23 +00:00
Chayim Refael Friedman
88d8c142b4 Rip Chalk out of the codebase! 2025-10-20 11:21:28 +03:00
A4-Tacks
416ff1c2c1
Fix missing RestPat for convert_named_struct_to_tuple_struct
Example
---
```rust
struct Inner;
struct A$0 { inner: Inner }
fn foo(A { .. }: A) {}
```

**Before this PR**:

```rust
struct Inner;
struct A(Inner);
fn foo(A(): A) {}
```

**After this PR**:

```rust
struct Inner;
struct A(Inner);
fn foo(A(..): A) {}
```
2025-10-20 15:04:51 +08:00
Shoyu Vanilla (Flint)
9c494da486
Merge pull request #20867 from ChayimFriedman2/to-ns-almost-final
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
Migrate variance to the next solver and remove lint allows from its stuff
2025-10-20 06:22:49 +00:00
Chayim Refael Friedman
c7e7eb9dc4
Merge pull request #20866 from ShoyuVanilla/metadata-err
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: Run `cargo metadata` on sysroot with cwd=sysroot
2025-10-19 18:26:50 +00:00
Chayim Refael Friedman
67295e803c Remove lint allows from new solver stuff 2025-10-19 21:14:10 +03:00
Chayim Refael Friedman
78517d83a4 Migrate variance to the new solver 2025-10-19 21:14:10 +03:00
Shoyu Vanilla (Flint)
370c5c9684
Merge pull request #20860 from A4-Tacks/migrate-single-field-from
Migrate `generate_single_field_struct_from` assist to use `SyntaxEditor`
2025-10-19 17:04:56 +00:00
Shoyu Vanilla (Flint)
c1b4b64813
Merge pull request #20845 from A4-Tacks/migrate-add-braces
Migrate `add_braces` assist, because edit_in_place uses ted
2025-10-19 17:03:59 +00:00
Shoyu Vanilla (Flint)
765954a0ec
Merge pull request #20852 from ChayimFriedman2/xtask-install-never
Do not use `force-always-assert` in `xtask install` by default
2025-10-19 17:01:40 +00:00
Shoyu Vanilla (Flint)
cd2bcd6756
Merge pull request #20841 from ChayimFriedman2/to-ns
Migrate more stuff to the next solver
2025-10-19 17:00:44 +00:00
Shoyu Vanilla
5c537596f5 fix: Report metadata errors for sysroot 2025-10-20 01:55:52 +09:00
Shoyu Vanilla
dcab2ad02b fix: Run cargo metadata on sysroot with cwd=sysroot 2025-10-19 18:31:26 +09:00
A4-Tacks
a3fed40833
Migrate generate_single_field_struct_from assist to use SyntaxEditor 2025-10-18 10:21:35 +08:00
David Barsky
1e20331e42
Merge pull request #20855 from ChayimFriedman2/improve-fixture2
Some checks failed
rustdoc / rustdoc (push) Has been cancelled
metrics / build_metrics (push) Has been cancelled
metrics / generate_final_metrics (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 / other_metrics (webrender-2022) (push) Has been cancelled
feat: Improve fixture support
2025-10-17 15:18:06 +00:00
Chayim Refael Friedman
d135cab1cd
Merge pull request #20858 from A4-Tacks/inlay-suffix-underscore
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
Support underscore suffix parameter hide inlayHints
2025-10-17 13:40:23 +00:00
A4-Tacks
700748e958
Support underscore suffix parameter hide inlayHints
Using suffix underscores to avoid keywords is one of the common skill, and inlayHints hiding should support it

Example
---

**Before this PR**:

```rust
fn far(loop_: u32) {}
fn faz(r#loop: u32) {}

let loop_level = 0;
far(loop_level);
  //^^^^^^^^^^ loop_
faz(loop_level);
```

**After this PR**:

```rust
fn far(loop_: u32) {}
fn faz(r#loop: u32) {}

let loop_level = 0;
far(loop_level);
faz(loop_level);
```
2025-10-17 18:51:18 +08:00
Chayim Refael Friedman
81e621af0b Improve fixture support
Support more features beside highlighting, and support items from minicore.
2025-10-16 22:06:16 +03:00
Ed Page
8231a2b01c feat(parser): Don't error on frontmatter 2025-10-16 11:07:05 -05:00
Ed Page
fff06bc181 test(parser): Show current frontmatter behavior 2025-10-16 11:06:41 -05:00
Ed Page
d57f543373 refactor(parser): Push higher level content 2025-10-16 10:58:31 -05:00