2018: assists: add assist for custom implementation for derived trait r=matklad a=paulolieuthier
Please, tell me if something could be more idiomatic or efficient.
Fixes#1256.
Co-authored-by: Paulo Lieuthier <paulolieuthier@gmail.com>
2343: implement assist invert_if r=matklad a=bravomikekilo
fix [issue 2219 invert if condition](https://github.com/rust-analyzer/rust-analyzer/issues/2219)
I put the assist cursor range to `if` of the if expression, because both condition and body will be replaced. Is there any way to replace them without cover the cursor position?
@matklad
Co-authored-by: bravomikekilo <bmk1221@126.com>
2165: ra_assists: Add add_new assist r=matklad a=rep-nop
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.
Not marking this as closing #1644 since there's a part 2 of adding autocompletion for when someone starts typing `[pub ]fn new(...`
Co-authored-by: Wesley Norris <repnop@outlook.com>
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.
2099: Fix panic on raw string assist r=matklad a=aee11
Strings that do not contain two quotation marks would cause a slice indexing panic because `find_usual_string_range` would return a range that only contained a single quotation mark.
Panic example:
```
fn main() {
let s = "<|>
}
```
I noticed a lot of panics from the `make_raw_string` assist while working on another issue today.
Co-authored-by: Alexander Elís Ebenesersson <alex2789@gmail.com>
Strings that do not contain two quotation marks
would cause a slice indexing panic because code
was assuming `find_usual_string_range` would return
a string with two quotes, but it would incorrectly
also return text ranges containing only a single quote.