Prajwal S N
688464d5e6
fix: make::expr_call() -> CallExpr
...
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-11 02:57:44 +05:30
Prajwal S N
ab620e367d
fix: make::expr_method_call() -> MethodCallExpr
...
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-11 02:50:20 +05:30
Prajwal S N
728d72fbe1
fix: make::expr_closure() -> ClosureExpr
...
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-11 02:50:16 +05:30
Prajwal S N
92a7890814
fix: make::expr_paren() -> ParenExpr
...
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-11 02:50:13 +05:30
Chayim Refael Friedman
8a9a1e3345
Remove all upcasts!
...
It turns out there were a lot redundant too.
2025-04-10 11:08:38 +03: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
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
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
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
62e7d9f0fc
Merge pull request #19433 from snprajwal/fix-replace-let-else
...
fix(ide-assists): `let else` to `if let else`
2025-03-25 13:20:12 +00:00
Prajwal S N
4fdb7dcac0
fix(ide-assists): let else
to if let else
...
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-03-24 01:08:14 +05:30
Lukas Wirth
500ea05aef
chore: Bump dependencies
2025-03-23 08:46:10 +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
Ali Bektas
1afbcc06f3
Test unsafeness is respected when manual impling derives
2025-03-17 22:37:21 +01:00
Ali Bektas
824df43d2d
Observe unsafeness only for replace_derive_with_manual_impl
2025-03-17 21:57:21 +01:00
Ali Bektas
477b987179
Observe unsafeness when generating manual impls of former derives
2025-03-17 21:55:27 +01:00
BenjaminBrienen
7535bb4661
cargo fmt
2025-03-15 21:32:01 +01:00
Vishruth-Thimmaiah
53f3e6fd5f
feat: for loop to while let assist
2025-03-14 19:15:37 +05:30
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
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
Lukas Wirth
cf255a61d5
Merge pull request #19079 from ChayimFriedman2/rename-conflict
...
feat: Warn the user when a rename will change the meaning of the program
2025-03-10 08:59:43 +00:00
Shoyu Vanilla
5b202cb663
fix: Prevent wrong invocations of needs_parens_in
with non-ancestral "parent"s
2025-03-09 18:54:22 +09:00
Shoyu Vanilla
c6ea7cbafa
internal: Migrate inline_local_variable
to SyntaxEditor
2025-03-09 15:51:37 +09: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
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
Lukas Wirth
03f90b0afa
Merge pull request #19261 from Veykril/push-rnqlyrvqpols
...
Support tuple struct patterns for expand_rest_pattern assist
2025-03-03 11:51:07 +00:00
Lukas Wirth
4ad546f6a6
Support tuple struct patterns for expand_rest_pattern assist
2025-03-03 12:35:53 +01:00
Lukas Wirth
0f4e6104e0
Normalize some assist names
2025-03-02 09:09:12 +01:00
Lukas Wirth
7273d714af
Merge pull request #19259 from Veykril/push-skmvrmtorqso
...
Add flip or-pattern assist
2025-03-02 07:41:42 +00:00
Lukas Wirth
1ce1f087da
Merge pull request #19253 from ShoyuVanilla/migrate-convert-bool-then
...
internal: Migrate `convert_bool_then` to `SyntaxEditor`
2025-03-02 07:21:04 +00:00
Lukas Wirth
f7569a4426
Add flip or-pattern assist
2025-03-02 08:04:27 +01:00
Lukas Wirth
570c6adcd3
Remove syntax editing from parenthesis computation
2025-03-01 18:32:04 +01:00
Shoyu Vanilla
37822d5917
Migrate convert_bool_then
to SyntaxEditor
...
Update assist docs
2025-03-01 13:12:15 +09:00
Lukas Wirth
e92dc3fd80
Have inline_local_variable use precedence calculation for parentheses
2025-02-28 11:03:33 +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
Giga Bowser
f155aef64d
internal: Migrate remove_unused_param
assist to SyntaxEditor
2025-02-25 11:52:13 -05:00
Giga Bowser
6dda2e81c6
internal: Migrate remove_parentheses
assist to SyntaxEditor
2025-02-25 11:52:13 -05:00
Giga Bowser
daca6b88c4
internal: Migrate remove_mut
assist to SyntaxEditor
2025-02-25 11:52:13 -05:00