1164 Commits

Author SHA1 Message Date
Hayashi Mikihiro
48027bfc19 handle trait in function
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-15 15:12:31 +09:00
Hayashi Mikihiro
55dd2114ed check glob
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-15 14:01:05 +09:00
Hayashi Mikihiro
bf13549ab6 rename fn name take_path to any
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-15 13:18:30 +09:00
Hayashi Mikihiro
30fe761685 fix: Removing all unused imports removes used imports for imports used for Derive macros
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-14 23:51:23 +09:00
Lukas Wirth
fdfa707807
Merge pull request #19747 from Veykril/push-kqxvxrxozswr
fix: Fix `move_bounds` assists not working for lifetimes
2025-05-05 13:18:20 +00:00
Lukas Wirth
f9c83edf12 fix: Fix move_bounds assists not working for lifetimes 2025-05-05 15:07:36 +02:00
Vishruth-Thimmaiah
4771b84a75
feat: add an assist to unwrap a type with a generic arg
This assist unwraps a type into its generic type argument, ignoring
const and lifetime arguments
2025-05-05 13:22:02 +05:30
Lukas Wirth
235d88bf42 Render more lifetimes 2025-05-02 14:36:18 +02:00
Matthias Krüger
573c47c9ba remove a couple of clones 2025-05-01 11:41:42 +02:00
Lukas Wirth
c5051019b4
Merge pull request #19542 from snprajwal/let-else-to-match
refactor: migrate `let_else_to_match` to editor
2025-04-28 15:27:28 +00:00
Prajwal S N
d25c175b3e
refactor: migrate merge_imports to syntax editor
Co-authored-by: Tarek <tareknaser360@gmail.com>
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28 17:32:36 +05:30
Prajwal S N
c6ae7b3541
chore: rename unmerge_use to unmerge_imports
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28 17:32:05 +05:30
Prajwal S N
bb493649d2
fix: migrate unmerge_use to syntax editor
Also ensures that attributes on the use item are applied to the new use
item when unmerging.

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28 17:31:23 +05:30
Prajwal S N
2eb7389b63
refactor: migrate let_else_to_match to editor
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28 17:19:17 +05:30
Lukas Wirth
0fee71065b
Merge pull request #19704 from Veykril/push-wrvznvvpvtvp
Add expression fill mode variant for filling with underscore expressions
2025-04-28 09:45:04 +00:00
Lukas Wirth
7e526b6be7 Add expression fill mode variant for filling with underscore expressions 2025-04-28 10:39:36 +02:00
Chayim Refael Friedman
d8887c0758
Merge pull request #19692 from vishruth-thimmaiah/remove_underscore_for_used_var
feat: adds an assist to remove underscores from used variables
2025-04-26 19:00:49 +00:00
Vishruth-Thimmaiah
47c22bf916
feat: adds an assist to remove underscores from used variables
adds an assist that suggests removing any underscore prefixes from used
variables.
2025-04-27 00:13:42 +05:30
Wilfred Hughes
eb23af9e73 Clarify text for add_braces assist
"to arm expression" is hard to parse, because "arm" can be a verb. Not
all Rust users may know that "arm" refers to a `match` expression
either.

Tweak the wording to make the sentence easier to parse, and clarify
that this assist refers to `match`. Use the same wording style for the
closure version too.
2025-04-25 22:15:22 -07:00
Lukas Wirth
669a30852b
Merge pull request #19622 from A4-Tacks/raw-string-suffix
Fix ide-assists raw_string suffix fail
2025-04-22 11:43:17 +00:00
Chayim Refael Friedman
0f325c7ff8 Remove unnecessary predefined symbol clones
Now that they're const it's no longer needed.

Nothing manual was performed: only a regexp search of `sym::([\w][\w\d]*)\.clone\(\)` and replace by `sym::$1`.
2025-04-21 03:10:13 +03:00
Chayim Refael Friedman
9477e46bec Get rid of static predefined symbols
Make them all `const`.
2025-04-21 03:07:35 +03:00
Chayim Refael Friedman
c58ddafe90 Make HirFileId, EditionedFileId and macro files Salsa struct
And make more queries non-interned.

Also flip the default for queries, now the default is to not intern and to intern a query you need to say `invoke_interned`.
2025-04-19 22:10:52 +03:00
A4-Tacks
13bdfab6b5
Fix replace_string_with_char escaped char quote 2025-04-19 19:16:44 +08:00
A4-Tacks
9ef1417d45
Support ide-assists raw_string suffix 2025-04-18 22:06:22 +08:00
Lukas Wirth
ea273513ed
Merge pull request #19591 from snprajwal/fix-make-macro
fix: use `ast::TokenTree` in `make::expr_macro`
2025-04-16 07:47:25 +00:00
Prajwal S N
243854211c
fix: use ast::TokenTree in make::expr_macro
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-16 13:06:42 +05:30
Hayashi Mikihiro
28e34c8d33 fix: `Extract into function include inline variable in fmt macro
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-04-15 11:19:50 +09:00
Lukas Wirth
7fc29a99ef
Merge pull request #19568 from snprajwal/destructure-struct-editor
refactor: editor for `destructure_struct_binding`
2025-04-14 15:35:00 +00:00
Lukas Wirth
aded72f8e6
Merge pull request #19572 from snprajwal/expand-rest-pattern
refactor: migrate `expand_rest_pattern` to editor
2025-04-14 14:50:08 +00:00
Prajwal S N
c7e5e33bb6
refactor: migrate expand_rest_pattern to editor
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-11 21:25:53 +05:30
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
Prajwal S N
c254537465
refactor: editor for destructure_struct_binding
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-11 02:36:23 +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