23804 Commits

Author SHA1 Message Date
Lukas Wirth
bbd40f8780
Merge pull request #21341 from Veykril/veykril/push-wsrtvrkzqyvr
internal: Move library and local root inputs to base-db
2025-12-27 10:24:52 +00:00
Lukas Wirth
1c67944f99 internal: Move library and local root inputs to base-db 2025-12-27 11:16:17 +01:00
Lukas Wirth
e08a7862a8
Merge pull request #20741 from A4-Tacks/comp-macro-segment
feat: Add macro segment completion
2025-12-27 10:02:35 +00:00
A4-Tacks
b5baf71afb
Minor fixup 2025-12-27 17:28:22 +08:00
bit-aloo
6ae410ccc7
remove crossbeam-channel from proc-macro-srv-cli 2025-12-27 10:40:42 +05:30
bit-aloo
5a91849218
make source_text take non mutable reference of self 2025-12-27 09:43:01 +05:30
bit-aloo
76ea9828a7
rename handler's to be context specific 2025-12-27 09:21:32 +05:30
bit-aloo
91b5c3c664
add bidirectional handle in proc-macro-srv-cli to interact with client and srv 2025-12-27 09:07:08 +05:30
A4-Tacks
d2cc89ffc7
Add macro segment completion
Example
---
```rust
macro_rules! foo {
    ($($x:$0)*) => ();
}
```

**Completion items**:

```text
ba block
ba expr
ba expr_2021
ba ident
ba item
ba lifetime
ba literal
ba meta
ba pat
ba pat_param
ba path
ba stmt
ba tt
ba ty
ba vis
```
2025-12-27 05:04:18 +08:00
bit-aloo
346625f5f8
adapt source_text to new handler 2025-12-26 23:04:19 +05:30
bit-aloo
3441c230e3
remove old subreq/resp constructs 2025-12-26 23:04:04 +05:30
bit-aloo
af0e298818
add bidirectionalHandler trait 2025-12-26 23:03:42 +05:30
Lukas Wirth
8c5a68e214
Merge pull request #21200 from ChayimFriedman2/fake-impls
perf: Do not really expand builtin derives, instead treat them specifically
2025-12-26 13:31:48 +00:00
Chayim Refael Friedman
6ed7084fe8 Test builtin derives expansions
Via a hack to disable their fast path.
2025-12-26 15:00:27 +02:00
Chayim Refael Friedman
bd934c08cf Allow IDE layer to "see" fake builtin derive impls
It sees them as regular impls; the details are abstracted. It's beautiful for the IDE layer, and less beautiful for `hir`, so this is a big change.

Some small differences still exist:

 - We show builtin derives impl (to the IDE layer) as if they have had no generic parameters. It is possible to show the parameters, but that means also having to handle fake impls in `TypeParam` etc., and the benefit is questionable.
 - Getting the fn *def* type of a method of a builtin derive impl is not supported, as there is no real `FunctionId`, therefore no `CallableDefId`. The trait method is returned instead. Note: getting the fn *ptr* type of the method is supported well.
 - Builtin derive impls and their methods do not fully support `HasSource`, because, well, they have no source (at least, not in the form of `ast::Impl` and `ast::Fn`). To support them, we use the derive's `TextRange` where possible, and the trait method's source when not.

 It's important to note that the def map still records the `MacroCallId`. I have doubts over this, as this means it's very easy to create the queries we don't want to create, but it does make things more convenient. In particular, a nicety of this setup is that even "Expand macro recursively" works (it creates the macro input/output query, but given that they will only be created when the user invokes the command, that does not seem to be a problem).
2025-12-26 15:00:08 +02:00
Lukas Wirth
97ac158aaa
Merge pull request #20193 from ChayimFriedman2/setting-rename-conflict
feat: Provide a setting to disable showing rename conflicts
2025-12-26 09:08:49 +00:00
Lukas Wirth
e2fea49975
Merge pull request #21330 from A4-Tacks/to-guarded-indent
Fix indent for convert_to_guarded_return
2025-12-26 09:02:22 +00:00
Lukas Wirth
c83c1a544c
Merge pull request #21335 from ChayimFriedman2/tupled-closure
internal: Store closures with "tupled" inputs
2025-12-26 08:18:20 +00:00
Lukas Wirth
c8d3e3abed
Merge pull request #21249 from Shourya742/2025-11-27-bidirectional-protocol
Add bidirectional messaging proc-macro-srv
2025-12-26 08:08:24 +00:00
Chayim Refael Friedman
5813fe7ff6 Stabilize type mismatch diagnostic 🎉 2025-12-26 09:35:55 +02:00
Chayim Refael Friedman
5fbff1d7fb Make builtin derives cheaper, by not really expanding them, instead store them unexpanded 2025-12-25 16:26:11 +02:00
Chayim Refael Friedman
7e515fccf8 Store closures with "tupled" inputs
And remove it when needed, the opposite of what was previously, where we stored without a tuple and tupled for the solver (because it requires that).

Because this is what rustc does, and generally, the closer we follow rustc, the easier our lives become.

The weird name `signature_unclosure()` also comes from rustc.
2025-12-25 16:18:11 +02:00
Lukas Wirth
af45994feb Introduce cargo-machete ci step 2025-12-25 10:38:05 +01:00
The rustc-josh-sync Cronjob Bot
958d68ccd2 Merge ref 'e7d44143a12a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: e7d44143a12a526488e4f0c0d7ea8e62a4fe9354
Filtered ref: fe2cf3fa56a4ce08f56aee660fbe289c7d13dede
Upstream diff: f41f40408d...e7d44143a1

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-25 04:19:28 +00:00
A4-Tacks
f953e2fa9d
Fix indent for convert_to_guarded_return 2025-12-24 21:46:57 +08:00
bit-aloo
41dade9006
return error on combination of bidirectional message and json framing 2025-12-23 23:14:47 +05:30
bit-aloo
9b03499a3b
chore: remove unwanted comments, extra lines and putting cli srv on default 2025-12-23 18:30:47 +05:30
Lukas Wirth
d63914222e fix: Fix flycheck generations not being synced for multiple workspaces
The diagnostics collection globally tracks the generation for all loaded workspaces as its shared between them, yet the flycheck actors track their own separate generations per workspace.
This mismatch could cause flycheck to not work correctly when multiple workspaces were loaded.
2025-12-23 13:57:06 +01:00
bit-aloo
1f64a69249
remove channels with callbacks in proc-macro-srv 2025-12-23 11:59:56 +05:30
bit-aloo
336f025424
remove internal callbacks, and move callback to rust-analyzer level 2025-12-23 07:58:53 +05:30
Jonathan Brouwer
f2e76266df
Rollup merge of #150267 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 31d2019672.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-12-22 17:33:37 +01:00
bit-aloo
2c71fa8cd4
rename PostcardNew to bidirectional-postcard-prototype 2025-12-22 20:56:16 +05:30
Laurențiu Nicola
ea18787e9c Fix name collision warning 2025-12-22 16:44:06 +02:00
bit-aloo
a79fa074fe
remove envelop and keep it simple 2025-12-22 20:04:35 +05:30
bit-aloo
f010e28689
remove request_id, rename postcardNew to BidirectionalPostcardPrototype and remove JsonNew 2025-12-22 19:21:05 +05:30
Laurențiu Nicola
624761a864
Merge pull request #21318 from rust-lang/rustc-pull
minor: Rustc pull update
2025-12-22 13:49:55 +00:00
A4-Tacks
ac01f880d7
Add BreakExpr completion suggest
- Move `ide::goto_definition::find_loops`
  into `ide_db::syntax_helpers::node_ext::find_loops`
2025-12-22 20:13:56 +08:00
Lukas Wirth
d1a3407ff8
Merge pull request #20595 from A4-Tacks/conv-iter-for-to-for-indent
Fix indent for convert_iter_for_each_to_for
2025-12-22 07:51:03 +00:00
A4-Tacks
d6a1e31373
Fix indent for convert_iter_for_each_to_for
Example
---
```rust
fn main() {
    {
        let it = core::iter::repeat(92);
        it.$0for_each(|param| match param {
            (x, y) => println!("x: {}, y: {}", x, y),
        });
    }
}
```

**Before this PR**:

```rust
fn main() {
    {
        let it = core::iter::repeat(92);
        for param in it {
            match param {
                    (x, y) => println!("x: {}, y: {}", x, y),
                }
        }
    }
}
```

**After this PR**:

```rust
fn main() {
    {
        let it = core::iter::repeat(92);
        for param in it {
            match param {
                (x, y) => println!("x: {}, y: {}", x, y),
            }
        }
    }
}
```
2025-12-22 14:47:27 +08:00
The rustc-josh-sync Cronjob Bot
0a5311af4d Merge ref 'f41f40408d71' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: f41f40408d719aa9ae0c6bfa17619d8f3f9e5b99
Filtered ref: 5abf37848786e70eb8136f43225b3470afea6dea
Upstream diff: 0208ee09be...f41f40408d

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-22 04:21:56 +00:00
Lukas Wirth
9d58a93602
Merge pull request #20439 from A4-Tacks/t-macro-bracket-doc
Add guess braces doc `T![]` for `T_`
2025-12-21 14:19:06 +00:00
Lukas Wirth
14cc41f2ba
Merge pull request #20438 from A4-Tacks/fix-guess-renamed-macro-braces
Fix guess renamed macro braces
2025-12-21 14:18:55 +00:00
Lukas Wirth
47037adcac
Merge pull request #20577 from A4-Tacks/nested-if-indent
Fix indent for merge_nested_if
2025-12-21 14:03:50 +00:00
Lukas Wirth
ee9783825a
Merge pull request #20576 from A4-Tacks/nested-if-let
Fix nested if-let for merge_nested_if
2025-12-21 14:03:26 +00:00
Lukas Wirth
5b9198d11f
Merge pull request #20597 from A4-Tacks/conv-to-guarded-ret-doc
Add LetStmt doc for convert_to_guarded_return
2025-12-21 14:02:06 +00:00
Lukas Wirth
3aecf081f6
Merge pull request #20996 from A4-Tacks/explicit-dot-call-deref
Add ide-assist: add_explicit_method_call_deref
2025-12-21 13:50:43 +00:00
Lukas Wirth
82d4f8bacd
Merge pull request #21304 from asukaminato0721/19168
internal: Improve recursive mbe parsing behavior
2025-12-21 12:39:05 +00:00
Chayim Refael Friedman
ccb2ffe653
Merge pull request #21311 from A4-Tacks/serde-derive-feature
internal: Fix hir-ty implicit serde derive feature
2025-12-21 07:42:18 +00:00
A4-Tacks
5abec3c2ce
internal: Fix hir-ty implicit serde derive feature
bad commit: 0dd3fe029a532c6c5fa3b0bdd7c4eb57843bb156
cwd: crates/hir-ty
cmd: cargo check
output: error: cannot find derive macro `Serialize` in this scope
2025-12-21 15:30:47 +08:00
Chayim Refael Friedman
8f28e82a4f
Merge pull request #21212 from A4-Tacks/comp-try-let-default-varname
Add default varname for TryEnum postfix completion
2025-12-21 06:13:23 +00:00