aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists
Commit message (Collapse)AuthorAgeFilesLines
* move into_ and as_ generation to a separate fileDomantas Jadenkus2021-02-274-402/+340
|
* cargo fmtDomantas Jadenkus2021-02-271-35/+20
|
* add generate_enum_as_method assistDomantas Jadenkus2021-02-273-0/+154
|
* deduplicate someDomantas Jadenkus2021-02-271-37/+28
|
* add generate_enum_into_method assistDomantas Jadenkus2021-02-273-20/+275
|
* make generate_enum_is_method work on any variantsDomantas Jadenkus2021-02-271-18/+95
|
* rename existing assist to generate_enum_is_methodDomantas Jadenkus2021-02-273-11/+11
|
* Disable "Flip comma" assist inside a macro callDenys Zadorozhnyi2021-02-261-2/+24
|
* docs(ide_assists): Change importMergeBehaviour to importMergeBehaviorSanchith Hegde2021-02-261-3/+3
|
* Merge #7741bors[bot]2021-02-243-0/+326
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7741: Add convert_for_to_iter_for_each assist r=mattyhall a=mattyhall Implements one direction of #7681 I wonder if this tries to guess too much at the right thing here. A common pattern is: ```rust let col = vec![1, 2, 3]; for v in &mut col { *v *= 2; } // equivalent to: col.iter_mut().for_each(|v| *v *= 2); ``` I've tried to detect this case by checking if the expression after the `in` is a (mutable) reference and if not inserting iter()/iter_mut(). This is just a convention used in the stdlib however, so could sometimes be wrong. I'd be happy to make an improvement for this, but not sure what would be best. A few options spring to mind: 1. Only allow this for types that are known to have iter/iter_mut (ie stdlib types) 2. Try to check if iter/iter_mut exists and they return the right iterator type 3. Don't try to do this and just add `.into_iter()` to whatever is after `in` Co-authored-by: Matt Hall <[email protected]>
| * Address further review commentsMatt Hall2021-02-241-51/+35
| | | | | | | | | | | | * Use known names for iter/iter_mut method (simplifies checking if the method exists * Extract code to check assist with fixtures to function
| * Address review commentsMatt Hall2021-02-231-33/+125
| | | | | | | | | | * Move code to build replacement into closure * Look for iter/iter_mut methods on types behind reference
| * Add convert_for_to_iter_for_each assistMatt Hall2021-02-233-0/+250
| |
* | Add tests for apply_demorganLukas Wirth2021-02-242-16/+78
| |
* | De Morgan's Law assist now correctly inverts <, <=, >, >=.lbrande2021-02-245-13/+53
| |
* | De Morgan's Law assist now correctly parenthesizes binary expressions.lbrande2021-02-243-11/+7
|/
* 7526: Rename crate assists to ide_assists.Chetan Khilosiya2021-02-2266-0/+27093