Commit graph

164736 commits

Author SHA1 Message Date
Nathaniel McCallum
6b8a812aaf parser: fix parsing of trait bound polarity and for-binders
The rustc AST allows both `for<>` binders and `?` polarity
modifiers in trait bounds, but they are parsed in a specific
order and validated for correctness:

  1. `for<>` binder is parsed first.
  2. Polarity modifiers (`?`, `!`) are parsed second.
  3. The parser validates that binders and polarity modifiers
     do not conflict:

```rust
if let Some(binder_span) = binder_span {
    match modifiers.polarity {
        BoundPolarity::Maybe(polarity_span) => {
            // Error: "for<...> binder not allowed with ? polarity"
        }
    }
}
```

This implies:

- `for<> ?Sized` → Valid syntax. Invalid semantics.
- `?for<> Sized` → Invalid syntax.

However, rust-analyzer incorrectly had special-case logic that
allowed `?for<>` as valid syntax. This fix removes that incorrect
special case, making rust-analyzer reject `?for<> Sized` as a
syntax error, matching rustc behavior.

This has caused confusion in other crates (such as syn) which
rely on these files to implement correct syntax evaluation.
2025-08-10 02:21:11 -04:00
Chayim Refael Friedman
eca3152835
Merge pull request #20409 from A4-Tacks/minicore-write
Add write! and writeln! to minicore
2025-08-10 01:39:58 +00:00
Hmikihiro
e3d99ddcbc fix: generate function by indet token 2025-08-09 15:48:10 +09:00
BenjaminBrienen
bb4fded8a3 remove duplicate field in Debug 2025-08-08 23:46:28 +02:00
A4-Tacks
5b9e6f1b75
Add write! and writeln! to minicore 2025-08-09 00:09:56 +08:00
Lukas Wirth
bc5df9b057
Merge pull request #20400 from rust-lang/veykril/push-ksxzmxqymsto
Disable error log for position clamping, its too noisy due to ease of triggering
2025-08-07 13:25:13 +00:00
Lukas Wirth
1a73720b80 Disable error log for position clamping, its too noisy due to ease of triggering 2025-08-07 15:14:22 +02:00
Shoyu Vanilla (Flint)
de3a71c145
Merge pull request #20394 from rust-lang/dependabot/npm_and_yarn/editors/code/tmp-0.2.4
Bump tmp from 0.2.3 to 0.2.4 in /editors/code
2025-08-07 04:40:34 +00:00
Hmikihiro
95440527af In extract_module.rs, generate ast::Module instead of String 2025-08-07 02:29:59 +09:00
dependabot[bot]
92b8797a09
Bump tmp from 0.2.3 to 0.2.4 in /editors/code
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.3 to 0.2.4.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/raszi/node-tmp/compare/v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-06 17:11:37 +00:00
Lukas Wirth
f5d70e9d09
Merge pull request #20393 from rust-lang/veykril/push-urpzrkwpkmxw
Fix non-lsp compliant `Response` definition
2025-08-06 16:12:58 +00:00
Lukas Wirth
51c6272bae Fix non-lsp compliant Response definition 2025-08-06 18:01:44 +02:00
Lukas Wirth
79d77a6cf1
Merge pull request #20392 from rust-lang/veykril/push-pxplxplxvvyy
Report the incorrect payload when failing to deserialize lsp messages
2025-08-06 15:42:24 +00:00
Lukas Wirth
d339009cbf Report the incorrect payload when failing to deserialize lsp messages 2025-08-06 17:30:18 +02:00
Chayim Refael Friedman
690bedeb34
Merge pull request #20354 from A4-Tacks/clean-lit-stmt-remove-dbg
Add remove literal dbg stmt for remove_dbg
2025-08-06 13:45:51 +00:00
A4-Tacks
0aa105740c
Add remove simple dbg stmt for remove_dbg
Remove only contain literals dbg statement

```rust
fn foo() {
    let n = 2;
    $0dbg!(3);
    dbg!(2.6);
    dbg!(1, 2.5);
    dbg!('x');
    dbg!(&n);
    dbg!(n);
    // needless comment
    dbg!("foo");$0
}
```
->
```rust
fn foo() {
    // needless comment
}
```
Old:
```rust
fn foo() {
    3;
    2.6;
    (1, 2.5);
    'x';
    &n;
    n;
    // needless comment
    "foo";
}
```
2025-08-06 21:33:10 +08:00
Shoyu Vanilla (Flint)
e1c954c619
Merge pull request #20387 from ChayimFriedman2/rename-macro
fix: Do not remove the original token when descending into derives
2025-08-06 10:17:18 +00:00
Chayim Refael Friedman
ae6a56bea2
Merge pull request #20384 from vxpm/fix-external-docs
fix external docs for exported macros
2025-08-05 21:21:24 +00:00
vinícius x
6a20b6d022 fix external docs for exported macros
add test
2025-08-05 18:09:10 -03:00
Chayim Refael Friedman
4d8547a331
Merge pull request #20381 from A4-Tacks/fix-assign-sug
Add assignment type analysis for ide-completion
2025-08-05 15:17:49 +00:00
A4-Tacks
b24866e619
Change prev whitespace to prev trivia 2025-08-05 20:54:38 +08:00
Shoyu Vanilla (Flint)
6b18724c38
Merge pull request #20385 from Hmikihiro/migrate_expand_glob_import
Migrate `expand_glob_import` assist to use `SyntaxEditor`
2025-08-05 09:47:09 +00:00
Shoyu Vanilla (Flint)
e514dd6a67
Merge pull request #20383 from Hmikihiro/remove_ted_from_replace_named_generic_with_impl
remove `ted` from replace_named_generic_with_impl.rs
2025-08-05 09:43:32 +00:00
Shoyu Vanilla (Flint)
14e9047bc7
Merge pull request #20380 from Hmikihiro/add_attr_arg
remove `add_attr()` from edit_in_place.rs because it use `ted`.
2025-08-05 09:37:25 +00:00
Lukas Wirth
37b5f626d6
Merge pull request #20389 from Veykril/push-ssyssvnrywvy
Slim down compile time artifact progress reports
2025-08-05 08:57:17 +00:00
Lukas Wirth
a0ca79e2ef Slim down compile time artifact progress reports 2025-08-05 10:45:54 +02:00
Chayim Refael Friedman
d064aca3c4 Do not remove the original token when descending into derives
This caused rename to remove both, because it couldn't rename the derive-expanded one.

I spent some time trying to create a test for this, before giving up. But I checked manually that this works.
2025-08-05 01:04:21 +03:00
Chayim Refael Friedman
069c953bdf Allow renaming when there are multiple definitions (due to macros) even when some cannot rename 2025-08-05 00:10:21 +03:00
Hmikihiro
67d099bf2f Migrate expand_glob_import assist to use SyntaxEditor 2025-08-05 01:16:57 +09:00
Hmikihiro
c91f9f0940 remove ted from replace_named_generic_with_impl.rs 2025-08-05 00:51:50 +09:00
Laurențiu Nicola
5ba502fcd3
Merge pull request #20378 from skewb1k/chore/folding_ranges-perms
chore: fix crates/ide/src/folding_ranges.rs file perms
2025-08-04 15:15:27 +00:00
Shoyu Vanilla (Flint)
1e2596dc6d
Merge pull request #20382 from ChayimFriedman2/goto-def-from-macro
fix: Correctly goto `From` impl when on `into()` even when the call is inside a macro
2025-08-04 15:10:06 +00:00
Chayim Refael Friedman
0ef8c6f2ad Correctly goto From impl when on into() even when the call is inside a macro
Descend into macros first.
2025-08-04 17:41:00 +03:00
Hmikihiro
6bc1d4d2aa remvoe add_attr edit_in_place.rs because it use ted. 2025-08-04 21:52:49 +09:00
skewb1k
bf500ec822 chore: fix crates/ide/src/folding_ranges.rs file perms
755 -> 644
2025-08-04 14:19:31 +03:00
A4-Tacks
b0bbfd1bb7
Add assignment type analysis for ide-completion 2025-08-04 01:59:03 +08:00
Hmikihiro
277cf46d3e Remove unused functions from edit_in_place 2025-08-03 19:40:54 +09:00
Lukas Wirth
0d2a7e6654
Merge pull request #20371 from Hmikihiro/migrate_generate_trait_from_impl
Migrate `generate_trait_from_impl` assist to use `SyntaxEditor`
2025-08-03 07:23:07 +00:00
Hmikihiro
b373cb1006 Migrate generate_trait_from_impl assist to use SyntaxEditor 2025-08-03 16:12:08 +09:00
Lukas Wirth
e47f791a60
Merge pull request #20368 from Hmikihiro/migrate_delegate_methods
Migrate `generate_delegate_methods` assist to use `SyntaxEditor`
2025-08-03 06:37:22 +00:00
Lukas Wirth
279b4643e8
Merge pull request #20364 from Hmikihiro/migrate_convert_from_to_tryfrom
Migrate `convert_from_to_tryfrom` assist to use `SyntaxEditor`
2025-08-03 06:36:15 +00:00
Lukas Wirth
f360d6ce88
Merge pull request #20351 from ChayimFriedman2/rename-self1
feat: When renaming a parameter to `self`, change callers to use method call syntax
2025-08-02 18:50:08 +00:00
Chayim Refael Friedman
ac34f3db81 When renaming a parameter to self, change callers to use method call syntax 2025-08-02 21:39:22 +03:00
Hmikihiro
e314bfaad3 Migrate generate_delegate_methods assist to use SyntaxEditor 2025-08-03 02:17:56 +09:00
Hmikihiro
81c4086a03 Migrate convert_from_to_tryfrom assist to use SyntaxEditor 2025-08-02 20:35:09 +09:00
Ifeanyi Orizu
7d167260ca Fix more docs 2025-08-01 10:48:54 -05:00
Ifeanyi Orizu
053f68151b Update documentation for overrideCommand config options 2025-08-01 10:48:54 -05:00
Shoyu Vanilla (Flint)
7c608658a7
Merge pull request #20345 from Hmikihiro/Migrate_add_trait_assoc_items_to_impl
add `SyntaxEditor::delete_all` to migrate utils.rs `add_trait_assoc_items_to_impl`
2025-07-31 15:11:22 +00:00
Lukas Wirth
a7b01aa048 cargo clippy --fix 2025-07-31 10:55:10 +02:00
Lukas Wirth
6bf97001f9
Merge pull request #20342 from Veykril/push-zysqtqskuxvr
Reorganize proc-macro-srv more, add `--format` and `--version` args
2025-07-31 08:21:52 +00:00