David Barsky
5d23772649
Merge pull request #18538 from tareknaser/syntax_factory_sort_items
...
Migrate `sort_items` Assist to Use `SyntaxFactory`
2024-12-05 19:21:51 +00:00
Tarek
8954a7f9e9
fix: rename syntax_editor_add_generic_param
to add_generic_param
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-05 13:50:43 +02:00
Tarek
b7e613c0dc
fix: update introduce_named_generic
to use type_param
directly
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 16:02:03 +02:00
Tarek
9157761f5d
refactor: move editing for ast using SyntaxEditor
to a separate file
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:51:48 +02:00
Tarek
2fb563f192
fix: refactor introduce_named_generic
assist
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
70ef2f23c2
fix: refactor syntax_editor_add_generic_param
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
54f7ed13f5
fix: refactor syntax_editor_add_generic_param
to handle adding new generic parameters
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
0990d5956d
fix: implement syntax_editor_create_generic_param_list
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
642d4f3385
define syntax_editor_add_generic_param
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
4af3d6f598
fix: remove make_mut from introduce_named_generic assist
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
1400aec433
feat: migrate introduce_named_generic assist to use SyntaxFactory
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
c43d565def
refactor: change target parameter to a reference in add_rewrite method
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 12:42:27 +02:00
Tarek
7149c4dab9
feat: migrate sort_items
assist to use SyntaxFactory
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 12:42:26 +02:00
Lukas Wirth
e6276c8b64
Merge pull request #18555 from ChayimFriedman2/issue-17321
...
fix: Fix a bug when synthetic AST node were searched in the AST ID map and caused panics
2024-12-03 15:39:52 +00:00
Chayim Refael Friedman
b66bc91b4b
Fix a bug when synthetic AST node were searched in the AST ID map and caused panics
2024-11-25 14:52:58 +02:00
David Barsky
c0bbbb3e5d
Merge pull request #18485 from davidkurilla/feat-migrate-add_braces-to-use-SyntaxFactory
...
feat: convert add_braces to SyntaxFactory SyntaxEditor abstraction
2024-11-19 21:05:17 +00:00
David Barsky
84078238c1
Merge pull request #18521 from tareknaser/syntax_factory_reorder_impl_items
...
Migrate `reorder_impl_items` Assist to Use `SyntaxFactory`
2024-11-19 20:38:57 +00:00
Laurențiu Nicola
a9aaa90d45
Merge pull request #18529 from cmrschwarz/allow_leading_whitespace_in_merge_match_arms
...
Improve selection handling for the `merge_match_arms` assist
2024-11-19 17:45:52 +00:00
Laurențiu Nicola
e761618aa4
Merge pull request #18459 from Giga-Bowser/match-placeholders
...
feat: Use snippet placeholders for generated match arms
2024-11-19 17:12:16 +00:00
Christian Schwarz
f12d5e3f20
improve selection handling for merge_match_arms
2024-11-19 08:22:13 +01:00
Tarek
05c2c162a5
feat: migrate reorder_impl_items
assist to use SyntaxFactory
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-11-17 12:17:44 +02:00
David Kurilla
888f9606d1
style: remove needless borrow
2024-11-15 19:08:01 +00:00
David Kurilla
b68ae2b150
style: cargo fmt
2024-11-15 18:02:16 +00:00
Tarek
5c41c20c11
feat: migrate reorder_fields
assist to use SyntaxFactory
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-11-13 15:02:08 +02:00
David Kurilla
c768a24673
fix: remove unused imports
2024-11-13 00:06:12 +00:00
David Kurilla
f3715c1d22
fix: fix indentation error
2024-11-12 23:58:24 +00:00
David Kurilla
9a805a2abd
fix: fix immutable tree error
2024-11-12 22:43:48 +00:00
David Kurilla
9f87bdc08a
feat: convert add_braces to SyntaxFactory SyntaxEditor abstraction
2024-11-06 14:45:00 +00:00
Giga Bowser
494bde3c13
Properly use final tabstop when adding missing match arms
2024-11-05 12:19:20 -05:00
Lukas Wirth
78f3112626
Allow interpreting consts and statics with interpret function command
2024-11-03 15:35:45 +01:00
Giga Bowser
92b2b3d26b
Use snippet placeholders for generated match arms
2024-11-01 12:35:01 -04:00
Lukas Wirth
70348faf2b
Move child_by_source from hir-def to hir
2024-10-31 09:28:08 +01:00
Lukas Wirth
bb3239d415
Merge pull request #18385 from Giga-Bowser/master
...
feat: Add assist to generate a type alias for a function
2024-10-30 09:36:55 +00:00
Lukas Wirth
64f56f458f
Move text-edit into ide-db
2024-10-28 14:37:41 +01:00
Lukas Wirth
3b3a87fe9b
Merge pull request #18419 from ChayimFriedman2/leading-or
...
fix: Put leading `|` in patterns under `OrPat`
2024-10-27 11:25:16 +00:00
Chayim Refael Friedman
e12a001b55
Put leading |
in patterns under OrPat
...
Previously it was one level above, and that caused problems with macros that expand to it, because macros expect to get only one top-level node.
2024-10-27 13:11:38 +02:00
Laurențiu Nicola
4e3c331d86
Turn Remove dbg into a quick fix for better prioritization
2024-10-26 09:06:10 +03:00
Giga Bowser
f753ff2242
Rework generate_fn_type_alias
2024-10-24 17:54:58 -04:00
Giga Bowser
3f48da27dd
Fix alphabetical order of handlers
...
No idea how this slipped past me
2024-10-23 11:54:48 -04:00
Giga Bowser
7b72a82bcb
Add assist to generate a type alias for a function
2024-10-23 11:31:15 -04:00
bors
546da8a5ad
Auto merge of #18294 - Giga-Bowser:master, r=Veykril
...
Add wrap/unwrap return type in Option
I pretty much just copied over the code and tests for wrapping/unwrapping return types in `Result` and then did a bunch of find and replace changes.
I handled unwrapping statements returning `None` by just replacing `None` with the unit type, but I'm open to suggestions for more intuitive behavior here.
2024-10-21 13:56:01 +00:00
Lukas Wirth
70d0b57cf0
Update ide tests
2024-10-21 11:28:19 +02:00
Giga Bowser
2c823865c6
Combine entry points for wrapping/unwrapping return types
2024-10-19 11:59:52 -04:00
Giga Bowser
c5b4fcebcc
Re-use code for wrapping/unwrapping return types
2024-10-17 10:04:28 -04:00
Giga Bowser
43b95ae4fc
Add wrap/unwrap return type in Option
2024-10-13 10:53:38 -04:00
Laurențiu Nicola
b9e58a2379
Merge from rust-lang/rust
2024-10-08 14:25:39 +03:00
DropDemBits
f9ad9a0bb6
minor: Use SyntaxEditor
in extract_variable
2024-09-26 16:29:16 -04:00
Laurențiu Nicola
f84aa5de4a
Add missing rustc_private
2024-09-25 10:56:37 +03:00
Shoyu Vanilla
d4de84f58a
fix: Temporary fix for remove_unused_imports
not handling import aliases correctly
2024-09-24 23:48:04 +09:00
bors
990c48cb0d
Auto merge of #18131 - ChayimFriedman2:macro-expand-dollar-crate, r=Veykril
...
fix: Get rid of `$crate` in expansions shown to the user
Be it "Expand Macro Recursively", "Inline macro" or few other things.
We replace it with the crate name, as should've always been.
Probably fixes some issues, but I don't know what they are.
2024-09-18 20:17:21 +00:00