Lukas Wirth
8b2be8572f
Rename some assists
2021-09-21 00:54:09 +02:00
Andrzej Głuszak
11a56f886b
assists: turn while into loop
2021-09-16 22:20:27 +02:00
Aleksey Kladov
46cdde75f8
internal: document tribal knowledge of how to assist
2021-09-13 14:19:10 +03:00
BooksBaum
478b2988c0
Add Destructure Tuple
2021-08-17 19:22:57 +02:00
Aleksey Kladov
a78decc466
internal: make assist naming consistent
2021-08-14 18:39:56 +03:00
Lukas Wirth
b7d7dd6163
Implement bool_then_to_if
assist
2021-08-10 13:17:45 +02:00
bors[bot]
caac771439
Merge #9735
...
9735: Add assist to sort members alphabetically. r=matklad a=vsrs
Supports traits, impls, structs, unions and enums (including inner struct variants). Does not support modules yet.
```rust
en┃um Animal {
Dog(String, f64),
Cat { weight: f64, name: String },
}
```
->
```rust
enum Animal {
Cat { weight: f64, name: String },
Dog(String, f64),
}
```
---
```rust
enum Animal {
Dog(String, f64),
Cat {┃ weight: f64, name: String },
}
```
->
```rust
enum Animal {
Dog(String, f64),
Cat { name: String, weight: f64 },
}
```
---
More samples in docs 0b7835619a/crates/ide_assists/src/handlers/sort_items.rs (L12-L83)
.
Relates #6110
Co-authored-by: vsrs <vit@conrlab.com>
2021-08-09 10:21:14 +00:00
Lukas Wirth
3b7c713af3
Implement if_to_bool_then assist
2021-08-08 17:56:34 +02:00
vsrs
643f3931f7
Sort trait and impl methods
2021-08-02 19:49:36 +03:00
Lukas Wirth
17a47a830b
Add replace_char_with_string assist
2021-07-30 16:46:06 +02:00
Lukas Wirth
46c42166d6
Yeet replace_unwrap_with_match
in favor of inline_call
2021-07-05 15:47:55 +02:00
Lukas Wirth
14e18bfa38
Merge the inline function/method assists into inline_call
2021-07-03 18:07:03 +02:00
Lukas Wirth
688398febc
feat: Implement inline_method
assist
2021-07-03 01:33:34 +02:00
rdambrosio
8e08b86304
Feat: inline generics in const and func trait completions
2021-06-17 19:54:28 -04:00
Aleksey Kladov
a91071b57b
internal: cut deps between assists and diagnostics
2021-06-14 17:45:17 +03:00
Aleksey Kladov
2e8dab631b
internal: prepare to move assist definitions
2021-06-14 17:45:17 +03:00
Maan2003
c50b4579ec
clippy::useless_return
2021-06-13 09:35:29 +05:30
Aleksey Kladov
4c8259e210
reduce duplication
2021-05-23 23:13:35 +03:00
Lukas Tobias Wirth
da74c66947
Correctly resolve crate name in use paths when import shadows itself
2021-05-23 19:37:01 +02:00
Aleksey Kladov
e6776c3e1b
use more precise name
2021-05-22 16:23:07 +03:00
Kirill Bulatov
90fc329377
Index retrieval fix
2021-05-03 19:35:44 +03:00
Kirill Bulatov
53a73de3d1
Small fixes
2021-05-03 18:45:30 +03:00
Kirill Bulatov
28293d370f
Add docs and use better naming
2021-05-03 18:16:35 +03:00
Kirill Bulatov
1679a376f3
Resolve single assist only
2021-05-03 18:03:28 +03:00
Kirill Bulatov
e5cdcb8b12
Add a way to resolve certain assists
2021-05-03 17:14:49 +03:00
bors[bot]
85bab7539a
Merge #8317
...
8317: Convert tuple struct to named struct assist r=Veykril a=unexge
Closes https://github.com/rust-analyzer/rust-analyzer/issues/8192
Co-authored-by: unexge <unexge@gmail.com>
2021-04-23 13:37:48 +00:00
bors[bot]
3f432730df
Merge #8467
...
8467: Adds impl Deref assist r=jhgg a=jhgg
This PR adds a new `generate_deref` assist that automatically generates a deref impl for a given struct field.
Check out this gif:
![2021-04-11_00-33-33](https://user-images.githubusercontent.com/5489149/114296006-b38e1000-9a5d-11eb-9112-807c01b8fd0a.gif )
--
I have a few Q's:
- [x] Should I write more tests, if so, what precisely should I test for?
- [x] I have an inline question on line 65, can someone provide guidance? :)
- [x] I can implement this for `ast::TupleField` too. But should it be a separate assist fn, or should I try and jam both into the `generate_deref`?
- [x] I want to follow this up with an assist on `impl $0Deref for T {` which would automatically generate a `DerefMut` impl that mirrors the Deref as well, however, I could probably use some pointers on how to do that, since I'll have to reach into the ast of `fn deref` to grab the field that it's referencing for the `DerefMut` impl.
Co-authored-by: jake <jh@discordapp.com>
2021-04-19 04:54:04 +00:00
Aleksey Kladov
460f0ef669
internal: unfork code paths for unresolved and resolved assist
2021-04-13 10:59:15 +03:00
jake
a624e2ea8d
Adds impl Deref assist
2021-04-11 00:42:05 -07:00
unexge
8d4be829e0
Add convert tuple struct to named struct assist
2021-04-04 20:52:43 +03:00
Graeme Coupar
ee03849017
Convert Into to From assist
...
This adds a "Convert Into to From" assist, useful since clippy has
recently started adding lints on every `Into`.
It covers converting the signature, and converting any `self`/`Self`
references within the body to the correct types.
It does assume that every instance of `Into` can be converted to a
`From`, which I _think_ is the case now. Let me know if there's
something I'm not thinking of and I can try and make it smarter.
2021-04-03 15:48:35 +01:00
Jonas Schievink
e39979aa91
Implement "Extract type alias" assist
2021-03-26 19:39:20 +01:00
Chetan Khilosiya
2bf3802f21
7709: Added the assist to generate is_empty function
...
the assist will be shown when the len function is implemented.
is_empty internally uses len function.
2021-03-15 21:31:52 +05:30
Luiz Carlos Mourão Paes de Carvalho
eea21490e0
feat: add assist to conver for_each into for loops
2021-03-09 22:58:17 -03:00
Chetan Khilosiya
cb3f4d43d9
7708: Initial implementation of generate Default assist.
...
The Generate Default impl from new function.
2021-03-07 00:49:03 +05:30
bors[bot]
2183d65c97
Merge #7777
...
7777: Implement line<->block comment assist r=Veykril a=djrenren
Fixes: https://github.com/rust-analyzer/rust-analyzer/issues/6515
Co-authored-by: John Renner <john@jrenner.net>
2021-03-02 08:04:38 +00:00
Aleksey Kladov
406d96c7d4
Use consistent naming for assist
2021-02-28 21:14:34 +03:00
Domantas Jadenkus
558bcf4e0b
generate try_into instead of into
2021-02-27 12:21:57 +02:00
Domantas Jadenkus
d4b6cbe5b6
rename generate_enum_match_method file to match assist name
2021-02-27 12:21:56 +02:00
Domantas Jadenkus
f098a2b31b
move into_ and as_ generation to a separate file
2021-02-27 12:21:06 +02:00
Domantas Jadenkus
e0f08fcc20
add generate_enum_as_method assist
2021-02-27 12:06:00 +02:00
Domantas Jadenkus
2dcd5d7a7c
add generate_enum_into_method assist
2021-02-27 12:05:59 +02:00
Domantas Jadenkus
f67586066d
rename existing assist to generate_enum_is_method
2021-02-27 12:05:59 +02:00
John Renner
9eecba4dbf
Implement line<->block comment assist
2021-02-24 17:13:00 -08:00
Matt Hall
506293ca43
Add convert_for_to_iter_for_each assist
2021-02-23 18:10:01 +00:00
Chetan Khilosiya
e4756cb4f6
7526: Rename crate assists to ide_assists.
2021-02-23 00:59:16 +05:30