Commit graph

2929 commits

Author SHA1 Message Date
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
fa53aab6f1
Merge pull request #19541 from Veykril/push-twqrorwqzmwv
fix(auto-import): Prefer imports of matching types for argument lists
2025-04-08 07:32:52 +00:00
Lukas Wirth
7255ef1375 fix(auto-import): Prefer imports of matching types for argument lists 2025-04-08 09:21:32 +02:00
Lukas Wirth
c5882732e6
Merge pull request #19425 from ConradIrwin/drop-drop-glue-goo
Tidy up drop glue notification
2025-04-07 10:32:50 +00:00
Lukas Wirth
7e00f91a72
Merge pull request #19531 from Veykril/push-kxyrpznnllkx
fix: Fix `format_args` lowering for >=1.87
2025-04-06 08:18:23 +00:00
Lukas Wirth
e7ce86ddea fix: Fix format_args lowering for >=1.87 2025-04-06 10:05:56 +02:00
Lukas Wirth
1d1771c15f
Merge pull request #19501 from ChayimFriedman2/macro-expansion
fix: Fix a bug in MBE expansion that arose from incorrect fixing of an older bug in MBE
2025-04-05 13:00:30 +00:00
Jonathan Chan Kwan Yin
1428aa9b6f
the rustdoc file prefix for constants is "constant" not "const" 2025-04-05 18:16:39 +08:00
Lukas Wirth
2261e4e892
Merge pull request #19522 from davidbarsky/davidbarsky/fix-panic-in-view-crate-graph
internal: fix panic in `view_crate_graph`
2025-04-04 16:00:18 +00:00
Lukas Wirth
8b6621a138
Merge pull request #19515 from jrmuizel/multiple-definitions
fix: don't drop references with more than one definition.
2025-04-04 15:50:33 +00:00
David Barsky
069de21793 internal: fix panic in view_crate_graph 2025-04-04 11:38:19 -04:00
Jeff Muizelaar
e9d997e97d fix: don't drop references with more than one definition.
Implicit field references during struct initialization were
being dropped because get_definition was returning None because
there were multiple definitions.

This adds a new helper, `get_defintions`, that supports returning
more than one definition for a given token and hooks it up.

Fixes #19393
2025-04-04 11:37:14 -04:00
BenjaminBrienen
2462624a7d prefer default over new 2025-04-04 15:49:50 +02: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
Chayim Refael Friedman
3953b604ce Fix a bug in MBE expansion that arose from incorrect fixing of an older bug in MBE
Specifically, #18744 was the PR that was supposed to fix the old bug, but it fixed it incorrectly (and didn't add a test!) The underlying reason was that we marked metavariables in expansions as joint if they were joint in the macro call, which is incorrect.

This wrong fix causes other bug, #19497, which this PR fixes by removing the old (incorrect) fix.
2025-04-01 21:05:51 +03:00
Lukas Wirth
1c7f253ec9 chore: Remove unnecessary Arc clones 2025-04-01 13:18:37 +02:00
Lukas Wirth
1e1571e1c8 fix: Fix new nightly lints 2025-03-31 13:27:54 +02:00
Lukas Wirth
2b382eb772 fix: Cleanup param name inlay hint filtering 2025-03-31 09:40:57 +02:00
Lukas Wirth
faf1b49a9a fix: Fix, clarify and require a value for proc_macro_cwd of CrateData 2025-03-29 08:08:48 +01:00
Conrad Irwin
498633ed97 Tidy up drop glue notification
This combines the memory layout and drop information on one line,
and makes the wording more succinct.

Closes #19410
2025-03-25 20:24:32 -06:00
Lukas Wirth
dd2354c985
Merge pull request #19435 from Veykril/push-owstqqlrtsko
fix: Fix closure return inlayhints using macro ranges
2025-03-24 07:00:54 +00:00
Lukas Wirth
d9b08e4431
Merge pull request #19430 from Veykril/push-wknpypxuyrsz
chore: Bump dependencies
2025-03-24 06:48:24 +00:00
Lukas Wirth
c760360abf fix: Fix closure return inlayhints using macro ranges 2025-03-24 07:45:31 +01:00
Lukas Wirth
37acea8052
Merge pull request #19400 from Shourya742/2025-03-20-fix-syntax-highlighting
Fix missing syntax highlighting for `&raw const` / `&raw mut` in all files.
2025-03-23 07:49:19 +00:00
Lukas Wirth
500ea05aef chore: Bump dependencies 2025-03-23 08:46:10 +01:00
Lukas Wirth
3bf18d4eba
Merge pull request #19419 from ShoyuVanilla/issue-15132
Render layout and other extra information on hovering `Self`
2025-03-22 17:56:21 +00:00
Shoyu Vanilla
ecc1ff8f33 Render layout and other extra informations on hovering Self 2025-03-22 23:53:59 +09: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
bit-aloo
cfac2c35dd
add test for &raw const/&raw mut is not syntax-highlighted in all files 2025-03-21 20:57:21 +05:30
bit-aloo
02cd8c5c90
change from krate to Option<krate> in syntax highlighting to incorporate modules which are not part of any crate 2025-03-21 20:56:53 +05:30
Lukas Wirth
3edfbcd502
Merge pull request #19348 from jnyfah/some-branch
Add text edit support for return type hints on non-block body closures
2025-03-21 14:15:06 +00:00
Lukas Wirth
d6dc1bf05e refactor: Reduce codegen burden for SyntaxKind 2025-03-21 12:14:39 +01:00
jnyfah
a0638e5f64 No edit if no body 2025-03-17 18:03:21 +01:00
jnyfah
061a643f64 some changes 2025-03-17 16:48:46 +01:00
Lukas Wirth
a505420751 chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
Lukas Wirth
b5eedad8e3 refactor: Remove unnecessary Arc 2025-03-16 10:27:48 +01:00
BenjaminBrienen
92ccf3dd8b cargo fmt 2025-03-15 21:32:01 +01:00
BenjaminBrienen
7535bb4661 cargo fmt 2025-03-15 21:32:01 +01:00
BenjaminBrienen
7f1912c748 cargo clippy --fix 2025-03-15 21:32:01 +01:00
BenjaminBrienen
aad66c7bf1 Fix 2024 syntax errors 2025-03-15 21:32:01 +01:00
Lukas Wirth
02a793bd59 chore: Remove legacy SyntaxContextId re-export 2025-03-15 17:09:17 +01:00
David Barsky
788232b355 internal: don't panic when the crate graph isn't ready #19351 2025-03-13 15:14:08 -04:00
jnyfah
1bbc0fbaa5 remove fixme 2025-03-13 10:53:34 +01:00
jnyfah
35443fac49 insert braces for closure 2025-03-13 09:04:47 +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
5a742d3da9
Merge pull request #19326 from Veykril/push-vovuxzkzrowp
Add missing name-ref parents to syntactic highlighting
2025-03-10 11:47:15 +00:00
Lukas Wirth
7ae98626fc Add missing name-ref parents to syntactic highlighting 2025-03-10 12:31:38 +01: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