Chayim Refael Friedman
2ae4ddbecb
Revert "internal: Rewrite attribute handling"
2025-10-22 19:19:13 +03:00
Chayim Refael Friedman
659aa56adb
Merge pull request #20316 from ChayimFriedman2/better-attrs
...
internal: Rewrite attribute handling
2025-10-22 12:46:19 +00:00
Chayim Refael Friedman
7773fe0fb8
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
922aad6b6d
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
1b945793ee
Merge pull request #20571 from A4-Tacks/type-kw-comp
...
Add type keywords completions
2025-10-22 03:52:52 +00:00
Chayim Refael Friedman
cef7df38b6
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
70e3d8ca5c
Add type keywords completions
...
Example
---
```
kw dyn
kw fn
kw for
kw impl
```
2025-10-22 11:35:09 +08:00
A4-Tacks
6fe555360e
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
db2e268314
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
911edbfe81
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
f04279b06d
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
f7a7ed8bfd
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
fe17c400de
Merge pull request #20882 from ChayimFriedman2/accurate-mem-report
...
internal: Clear next-solver cache before reporting memory usage in analysis-stats
2025-10-21 20:07:50 +00:00
Chayim Refael Friedman
d76463c857
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
Daniel Paoliello
ba61c29ce1
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)
3643535c16
Merge pull request #20850 from A4-Tacks/add-mis-match-arms-indent
...
Migrate `add_missing_match_arms` assist, because edit_in_place uses ted
2025-10-21 05:00:12 +00:00
Shoyu Vanilla (Flint)
d6573fde9d
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)
34af63109f
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
e6656c19b4
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
37147c4135
Add a FIXME for unordered fields
2025-10-21 11:27:50 +08:00
Chayim Refael Friedman
14c771a24c
Fix beta Clippy
2025-10-20 19:00:42 +03:00
Chayim Refael Friedman
aae9712904
Merge pull request #20873 from ChayimFriedman2/to-ns2
...
Rip Chalk out of the codebase 🎉
2025-10-20 15:37:53 +00:00
Lukas Wirth
d25a6763d2
Merge pull request #20876 from rust-lang/push-lznzsmuxzsot
...
fix: Fix `signature_help` to proto conversion creating invalid utf16 offsets
2025-10-20 14:40:04 +00:00
Lukas Wirth
b5263103b8
fix: Fix signature_help to proto conversion creating invalid utf16 offsets
2025-10-20 16:30:17 +02:00
Lukas Wirth
50577871b1
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
9b0d532687
Rip Chalk out of the codebase!
2025-10-20 11:21:28 +03:00
A4-Tacks
2c48c398f7
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)
2edfc8240b
Merge pull request #20867 from ChayimFriedman2/to-ns-almost-final
...
Migrate variance to the next solver and remove lint allows from its stuff
2025-10-20 06:22:49 +00:00
Chayim Refael Friedman
fd59d49d6e
Merge pull request #20866 from ShoyuVanilla/metadata-err
...
fix: Run `cargo metadata` on sysroot with cwd=sysroot
2025-10-19 18:26:50 +00:00
Chayim Refael Friedman
369715b77c
Remove lint allows from new solver stuff
2025-10-19 21:14:10 +03:00
Chayim Refael Friedman
6232ba8d08
Migrate variance to the new solver
2025-10-19 21:14:10 +03:00
Shoyu Vanilla (Flint)
7c871c2a4b
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)
b6c29e07ba
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)
e1a923a21e
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)
400896d1e1
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
4182a95e05
fix: Report metadata errors for sysroot
2025-10-20 01:55:52 +09:00
Shoyu Vanilla
0aa39c4233
fix: Run cargo metadata on sysroot with cwd=sysroot
2025-10-19 18:31:26 +09:00
A4-Tacks
d3263775c4
Migrate generate_single_field_struct_from assist to use SyntaxEditor
2025-10-18 10:21:35 +08:00
David Barsky
7a15d6d4f1
Merge pull request #20855 from ChayimFriedman2/improve-fixture2
...
feat: Improve fixture support
2025-10-17 15:18:06 +00:00
Chayim Refael Friedman
090b47ab39
Merge pull request #20858 from A4-Tacks/inlay-suffix-underscore
...
Support underscore suffix parameter hide inlayHints
2025-10-17 13:40:23 +00:00
A4-Tacks
9a2db55596
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
db6734e22f
Improve fixture support
...
Support more features beside highlighting, and support items from minicore.
2025-10-16 22:06:16 +03:00
Ed Page
77d9b8ec15
feat(parser): Don't error on frontmatter
2025-10-16 11:07:05 -05:00
Ed Page
223e141085
test(parser): Show current frontmatter behavior
2025-10-16 11:06:41 -05:00
Ed Page
468150578f
refactor(parser): Push higher level content
2025-10-16 10:58:31 -05:00
Chayim Refael Friedman
e9bba4f598
Do not use force-always-assert in xtask install by default
...
But add a flag to do so.
2025-10-16 13:08:27 +03:00
Lukas Wirth
082ecd8f73
Merge pull request #20757 from Shourya742/force-fileid-invariant-to-interner
...
Use FileId::MAX for id assertion in PathInterner::intern
2025-10-16 07:37:06 +00:00
A4-Tacks
d41a190c68
Migrate add_missing_match_arms assist, because edit_in_place uses ted
...
- And fix indentations
Example
---
```rust
fn main() {
match None$0 {
None => {
foo(
"foo",
"bar",
);
}
}
}
```
**Before this PR**:
```rust
fn main() {
match None {
None => {
foo(
"foo",
"bar",
);
}
Some(_) => todo!(),
}
}
```
**After this PR**:
```rust
fn main() {
match None {
None => {
foo(
"foo",
"bar",
);
}
Some(${1:_}) => ${2:todo!()},$0
}
}
```
2025-10-16 14:29:36 +08:00
A4-Tacks
b2566ff07b
Migrate add_braces assist, because edit_in_place uses ted
...
- And fix indent
Example
---
```rust
fn foo() {
{
match n {
Some(n) $0=> foo(
29,
30,
),
_ => ()
};
}
}
```
**Before this PR**:
```rust
fn main() {
{
match n {
Some(n) => {
foo(
29,
30,
)
},
_ => ()
};
}
}
```
**After this PR**:
```rust
fn foo() {
{
match n {
Some(n) => {
foo(
29,
30,
)
},
_ => ()
};
}
}
```
2025-10-15 19:26:59 +08:00
Chayim Refael Friedman
a78b257b31
Merge pull request #20836 from Elliot-Roberts/cfg-require-tt
...
Fix compile error in `crates/cfg` tests due to `tt` feature
2025-10-15 03:03:52 +00:00