Commit graph

531 commits

Author SHA1 Message Date
David Barsky
3e15dbc85f internal: fix NameGenerator's and AnyMap's rustdocs 2025-04-09 12:44:52 -04:00
Lukas Wirth
dc363f7f77
Merge pull request #19462 from Veykril/push-ypvprvvwkyll
refactor: Lower type-refs before type inference
2025-04-09 08:54:28 +00:00
Lukas Wirth
1fd9520c92 refactor: Lower type-refs before type inference
This refactors how we deal with items in hir-def lowering.

- It now lowers all of them through an "ExpressionStore" (kind of a misnomer as this point) as their so called *Signatures.
- We now uniformly lower type AST into TypeRefs before type inference.
- Likewise, this moves macro expansion out of type inference, resulting in a single place where we do non-defmap macro expansion.
- Finally, this PR removes a lot of information from ItemTree, making the DefMap a lot less likely to be recomputed and have it only depend on actual early name resolution related information (not 100% true, we still have ADT fields in there but thats a follow up removal).
2025-04-09 10:43:23 +02:00
Lukas Wirth
7255ef1375 fix(auto-import): Prefer imports of matching types for argument lists 2025-04-08 09:21:32 +02:00
BenjaminBrienen
2462624a7d prefer default over new 2025-04-04 15:49:50 +02:00
clubby789
546766f12b Stabilize cfg_boolean_literals 2025-04-03 18:10:48 +00:00
Prajwal S N
e02d76aa61
fix(ide-assists): remove AssistKind::None
This was being used by a single assist, which qualifies under the "refactor"
kind. The variant has been removed, and all usages updated accordingly.

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-03 14:38:31 +05:30
Lukas Wirth
2b382eb772 fix: Cleanup param name inlay hint filtering 2025-03-31 09:40:57 +02:00
Lukas Wirth
2e1ff255ae
Merge pull request #19375 from ChayimFriedman2/do-not-complete
feat: Allow crate authors to control completion of their things
2025-03-28 09:06:19 +00:00
Chayim Refael Friedman
7b584ef9bf Allow crate authors to control completion of their things
Via the new `#[rust_analyzer::completions(...)]` attribute.

Also fix a bug with existing settings for that where the paths wouldn't resolve correctly.
2025-03-27 14:01:26 +02:00
Lukas Wirth
454e4be40d refactor: Use MEDIUM durability for crate-graph changes, high for library source files
The idea here is that the crate graph may change over time, but library source file contents *never* will (or really never should). Disconnecting the two means that queries that depend on library sources will not need to re-validatewhen the crate graph changes (unless they depend on the crate graph in some capacity).
2025-03-26 06:46:49 +01:00
Lukas Wirth
500ea05aef chore: Bump dependencies 2025-03-23 08:46:10 +01:00
Lukas Wirth
d4122434dd chore: Remove unused dependencies 2025-03-23 08:08:17 +01:00
Felicián Németh
f2ad0fcb21 Speed up resolving "Generate delegate method" assist (part 2)
Make it compile by adding a `None` subtype to rest of the AssistId
instantiations.
2025-03-22 09:58:44 +01:00
Felicián Németh
7aa70a86d1 Speed up resolving "Generate delegate method" assist (part 1)
Fix #19322

Sometimes there are 185 "Generate delegate" assists with the same
assist_id and asssist_kind.  This commit introduces and additional
differentiator: assist_subtype.  Therefore, when the LSP client sends
an assist resolve request, rust-analyzer only need to compute edits
for a single assist instead of 185.
2025-03-22 09:41:34 +01:00
Lukas Wirth
3086e5fe90 chore: Remove some unnecessary usage of Semantics 2025-03-21 20:09:03 +01:00
Lukas Wirth
a505420751 chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
Michael Goulet
9f56c301d4 Suppress must_use for ControlFlow in rust-analyzer 2025-03-16 17:47:57 +00:00
BenjaminBrienen
7535bb4661 cargo fmt 2025-03-15 21:32:01 +01:00
Lukas Wirth
220d913cbc
Merge pull request #19366 from Veykril/push-mkunlxkysssr
chore: Remove legacy `SyntaxContextId` re-export
2025-03-15 16:25:13 +00:00
Lukas Wirth
02a793bd59 chore: Remove legacy SyntaxContextId re-export 2025-03-15 17:09:17 +01:00
Lukas Wirth
faf2bdde5f
Merge pull request #19356 from flodiebold/push-snpyvwuulkmw
fix: Avoid recursively debug printing crates
2025-03-14 18:19:05 +00:00
Florian Diebold
c1102ac703 Avoid recursively debug printing crates 2025-03-14 19:02:06 +01:00
Lukas Wirth
2ea09b2e47 Split variant_data into its own query 2025-03-14 14:16:33 +01:00
Lukas Wirth
12f54eec27 Split assoc items out of trait_data/impl_data queries 2025-03-14 13:31:41 +01:00
Chayim Refael Friedman
c94e9efbef Salsify the crate graph
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
2025-03-12 21:02:30 +02:00
David Barsky
74620e64ec internal: port rust-analyzer to new Salsa 2025-03-10 13:30:51 -04:00
Lukas Wirth
f81fcabdf9
Merge pull request #19332 from Veykril/push-trvznlqsvtyq
Make change annotations per text-edit
2025-03-10 11:25:13 +00:00
Lukas Wirth
70066399f0 Make change annotations per text-edit 2025-03-10 12:08:42 +01:00
Laurențiu Nicola
be48993351
Merge pull request #19331 from lnicola/sync-from-rust
minor: Sync from downstream
2025-03-10 09:52:17 +00:00
Lukas Wirth
27a5b1ba0c
Merge pull request #19330 from ChayimFriedman2/normalize-projection
fix: Normalize projections in evaluated const display and layout calculation
2025-03-10 09:15:35 +00:00
Laurențiu Nicola
363590b450 Merge from rust-lang/rust 2025-03-10 10:41:53 +02:00
Chayim Refael Friedman
62e7d2851b Warn the user when a rename will change the meaning of the program
Specifically, when a rename of a local will change some code that refers it to refer another local, or some code that refer another local to refer to it.

We do it by introducing a dummy edit with an annotation. I'm not a fond of this approach, but I don't think LSP has a better way.
2025-03-06 21:07:10 +02:00
Chayim Refael Friedman
2fc0dc0f13 Pass the target crate in HirFormatter
This is required to format evaluated consts, because we need trait env, and it needs the crate (currently it uses the last crate in topological order, which is wrong, the next commit will fix that).
2025-03-06 21:00:05 +02:00
许杰友 Jieyou Xu (Joe)
905ddf8cd8
Rollup merge of #137728 - Darksonn:no-tuple-unsize, r=oli-obk
Remove unsizing coercions for tuples

See https://github.com/rust-lang/rust/issues/42877#issuecomment-2686010847 and below comments for justification.

Tracking issue: #42877
Fixes: #135217
2025-03-05 21:46:44 +08:00
Lukas Wirth
27dc614627
Merge pull request #19274 from Veykril/push-pouwrwwrlrlt
Highlight unsafe operations as unsafe, not definitions
2025-03-05 12:57:25 +00:00
Lukas Wirth
9fc0ffe008 Use HIR unsafety information for unsafe syntax highlightng 2025-03-05 13:18:46 +01:00
Thalia Archibald
0811ca0a61 Use size_of from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.

These functions were added to all preludes in Rust 1.80.
2025-03-05 00:48:44 -08:00
Lukas Wirth
9200f77068 More precise macro modifiers for syntax highlighting 2025-03-01 17:23:51 +01:00
BenjaminBrienen
b19ef6b046 fix doc tests 2025-02-27 14:58:46 +01:00
BenjaminBrienen
bd7375a58f enable doctest 2025-02-27 14:58:46 +01:00
Alice Ryhl
4d0c1ee1bd Delete tuple unsizing 2025-02-27 10:26:33 +00:00
Lukas Wirth
0b2e8166a1 Remove limit crate in favor usize 2025-02-23 17:35:09 +01:00
Laurențiu Nicola
bec6d6fbe3 Merge from rust-lang/rust 2025-02-17 13:20:12 +02:00
Nicholas Nethercote
610f4c4046 Rename pattern_complexity attr as pattern_complexity_limit.
For consistency with `recursion_limit`, `move_size_limit`, and
`type_length_limit`.
2025-02-17 09:30:40 +11:00
Lukas Wirth
e0814742f0 fix: Do not show safety hints for extern items lacking semantics 2025-02-12 14:43:51 +01:00
Lukas Wirth
ab5e821d97 Expose symbol of CrateName 2025-02-04 14:38:58 +01:00
Lukas Wirth
b32ddea521 Split cache priming into distinct phases 2025-02-03 10:47:53 +01:00
David Barsky
bc10a44798
Merge pull request #19063 from davidbarsky/davidbarsky/backout-struct-default-fields
internal: backout `hir-*` changes from #19001
2025-01-28 16:45:45 +00:00
Lukas Wirth
07a09c154e
Merge pull request #19015 from Wilfred/mdbook
manual: Convert to mdbook
2025-01-28 16:19:37 +00:00