Kirill Bulatov
9be1ab7ff9
Code review fixes
2020-01-27 14:42:45 +02:00
Kirill Bulatov
1a78991df6
Adjust the tests
2020-01-27 00:57:24 +02:00
Kirill Bulatov
d0a782ef1c
Have a better trait interface
2020-01-27 00:17:10 +02:00
Kirill Bulatov
f57239729c
Remove unnecessary lifetime parameter
2020-01-27 00:16:29 +02:00
Kirill Bulatov
316795e074
Initial auto import action implementation
2020-01-27 00:16:29 +02:00
TomasKralCZ
8dc94a452c
fix typo in 'inline_local_variable'
2020-01-19 17:39:53 +01:00
Kirill Bulatov
d51cf7794d
itertools::Either -> either::Either
2020-01-15 20:20:20 +02:00
Kirill Bulatov
78a21253b4
Apply the api design suggestions
2020-01-15 20:17:17 +02:00
Kirill Bulatov
73dc8b6f06
Another attempt to add multiple edits
2020-01-15 20:16:27 +02:00
Jeremy Kolb
e04661e495
Fix casing
2020-01-14 12:32:26 -05:00
Florian Diebold
15fc643e05
Fix ordering problem between qualifying paths and substituting params
2020-01-11 23:33:04 +01:00
Paulo Lieuthier
439080f027
assists: add assist for custom implementation for derived trait
2019-11-28 16:56:06 -03:00
bravomikekilo
8a8be06219
initial invert_if
2019-11-22 02:51:40 +08:00
Wesley Norris
cbc6f94573
Add add_new assist
...
Adds a new assist to autogenerate a new fn based on the selected struct,
excluding tuple structs and unions. The fn will inherit the same
visibility as the struct and the assist will attempt to reuse any
existing impl blocks that exist at the same level of struct.
2019-11-09 10:56:36 -05:00
Aleksey Kladov
42370610ce
Restore assists tests
2019-11-04 22:28:47 +03:00
Aleksey Kladov
74d827bb80
Rename MockDatabase -> TestDB
...
Actually working rename is sooo useful!
2019-11-04 22:21:15 +03:00
Aleksey Kladov
24894aca31
Remove more duplication in test fixtures
2019-11-04 22:12:49 +03:00
Aleksey Kladov
ad3fe316c6
further simplify assists
2019-10-27 18:22:14 +03:00
bors[bot]
ad950830d0
Merge #2090
...
2090: move public stuff to top r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-27 14:13:09 +00:00
Wesley Norris
3a64a85a52
Fixes #2054 .
...
This adds the `flip_trait_bound` assist which allows for the swapping of two trait bounds in a trait list that are next to each other.
2019-10-27 16:52:33 +03:00
Aleksey Kladov
73532e900e
rename auto_import -> add_import
...
We are long way from auto imports at the moment
2019-10-27 16:46:49 +03:00
Aleksey Kladov
0dd35ff2b2
auto-generate assists docs and tests
2019-10-25 14:47:48 +03:00
Mikhail Modin
fb215dc192
Adds "replace with guarded return" assist
2019-10-20 19:14:32 +01:00
Lúcás Meier
ad65ba4062
WIP: Add demorgan application with naive negation
2019-10-03 22:19:46 +02:00
Aleksey Kladov
05ca252fb5
remove ast_editor.rs
2019-09-30 10:05:12 +03:00
Aleksey Kladov
d847d53e36
Start simplifying editing API
2019-09-26 22:22:08 +03:00
Aleksey Kladov
183a38fb50
keep ast creation API simple
2019-09-26 15:29:28 +03:00
Aleksey Kladov
69689625ce
move ast builder to a separate file
2019-09-25 14:35:26 +03:00
Aleksey Kladov
f32081fa18
move assists to subdir
2019-09-25 14:29:41 +03:00
Geobert Quach
b6d55290a1
feat(assists): raw string <-> usual string manipulation
...
Fixes #1730
2019-09-19 22:12:28 +01:00
Nelson Chen
14585468e2
Minor typo fix for ra_assists code doc
2019-09-08 02:10:53 -07:00
Ekaterina Babshukova
acb89d2be1
add assist to move type bounds to where clause
2019-09-05 13:29:13 +03:00
Phil Ellison
e6113c0998
Add merge_match_arm assist, bump rowan to 0.6.1
2019-07-29 21:59:52 +01:00
Aleksey Kladov
1834bae5b8
allow rustfmt to reorder imports
...
This wasn't a right decision in the first place, the feature flag was
broken in the last rustfmt release, and syntax highlighting of imports
is more important anyway
2019-07-04 23:09:09 +03:00
Unreal Hoang
08e954f0fd
add assist to move arm condition to match guard
2019-05-21 23:31:51 +09:00
Unreal Hoang
99ad6143cd
rename
2019-05-16 12:53:52 +09:00
Sergey Parilin
12f8472d28
removed duplicating fill_struct_fields assist
2019-05-06 17:26:09 +03:00
Unreal Hoang
f83e452b1e
move guard to arm body assist.
2019-05-02 00:42:00 +09:00
bors[bot]
c416caeda2
Merge #1194
...
1194: Pr 1190 r=matklad a=matklad
Co-authored-by: Andrea Pretto <eulerdisk@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-04-22 13:19:47 +00:00
Aleksey Kladov
5b2fd86d25
more type safety
2019-04-22 10:11:06 +03:00
Andrea Pretto
9144214958
complete_import: add new import resolver infrastructure with some hardcoded importable name.
...
Changes complete_scope to support that.
2019-04-22 00:14:58 +02:00
Aleksey Kladov
7cc845e88d
start structured editing API
2019-04-21 20:51:20 +03:00
Marco Groppo
a4ba3841b4
Add explicit type assist.
2019-04-08 19:56:37 +02:00
Marco Groppo
12b5d4f795
Assist to flip (some) binary expressions.
...
This assist can flip the following operators: ==, !=, >, >=, <, <=.
2019-03-25 23:53:57 +01:00
bors[bot]
d88a96bd05
Merge #1037
...
1037: inline immutable local varialbe r=matklad a=gfreezy
resolved #1033
Co-authored-by: gfreezy <gfreezy@gmail.com>
2019-03-25 14:11:18 +00:00
bors[bot]
965363db15
Merge #1036
...
1036: Assist to flip equality (==) and negated equality (!=) operands. r=matklad a=marcogroppo
This PR adds an assist to flip the equality operands.
I hope this is the right way to do this (I'm a newbie...)
Fixes #1023 .
Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
2019-03-25 07:04:47 +00:00
gfreezy
fd1585a071
inline immutable local varialbe
2019-03-25 10:18:20 +08:00
Marco Groppo
481d3f56cf
Assist to flip equality (==) and negative equality (!=) operands.
2019-03-24 14:42:11 +01:00
gfreezy
02383b91d5
Add assist for adding default methods
2019-03-23 23:13:07 +08:00
bors[bot]
7c117567ab
Merge #989
...
989: Implement naive version of fill_struct_fields assist r=matklad a=yanchith
Fixes #964
This implements the `fill_struct_fields` assist. Currently only works for named struct fields, but not for tuple structs, because we seem to be missing a `TupleStructLit` (akin to `StructLit`, but for tuple structs). I am happy to implement `TupleStructLit` parsing given some guidance (provided it's really missing) and make the assist work for tuple structs as well. Could do so either in this PR, or another one 🙂
Sorry if I missed something important, this is my first PR for Rust Analyzer.
Btw is there any way to run the assists in emacs?
UPDATE: I just realized that parsing `TupleStructLit` would be quite difficult as it it really similar, if not identical to a function call...
Co-authored-by: yanchith <yanchi.toth@gmail.com>
2019-03-18 08:24:18 +00:00