aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/handlers
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | 7708: Added the logic to check is default impl is already present.Chetan Khilosiya2021-03-061-18/+97
| | | | | | | | | | | | | | | | Also added test cases for code present within module.
| * | | 7708: Updated generate default fn logic.Chetan Khilosiya2021-03-061-22/+48
| | | |
| * | | 7708: Added the work for review comments.Chetan Khilosiya2021-03-061-31/+60
| | | | | | | | | | | | | | | | Also added 1 test case to test multiple struct blocks are present.
| * | | 7708: Fixed many documentaion example issues.Chetan Khilosiya2021-03-061-6/+6
| | | |
| * | | 7708: Format code through rust-analyzer formatter.Chetan Khilosiya2021-03-061-35/+44
| | | |
| * | | 7708: Initial implementation of generate Default assist.Chetan Khilosiya2021-03-061-0/+221
| | |/ | |/| | | | | | | The Generate Default impl from new function.
* | | Merge #7865bors[bot]2021-03-061-1/+37
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 7865: preserve escape sequences when replacing string with char r=Veykril a=jDomantas Currently it replaces escape sequence with the actual value, which is very wrong for `"\n"`. Co-authored-by: Domantas Jadenkus <[email protected]>
| * | preserve escape sequences when replacing string with charDomantas Jadenkus2021-03-031-1/+37
| | |
* | | generate function assist convert arg names to lower snake caseJosh Mcguigan2021-03-061-4/+52
| |/ |/|
* | Merge #7869bors[bot]2021-03-051-0/+43
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 7869: Add support for deref assignments to "pull assignment up" assist. r=Veykril a=Jesse-Bakker Fixes #7867 Co-authored-by: Jesse Bakker <[email protected]>
| * | Add support for deref assignments to "pull assignment up" assist.Jesse Bakker2021-03-051-0/+43
| |/ | | | | | | Fixes #7867
* | Merge #7880bors[bot]2021-03-051-2/+8
|\ \ | |/ |/| | | | | | | | | | | 7880: Honor snippet capability when using the extract function assist r=lnicola a=Arthamys This fixes issue #7793 Co-authored-by: san <[email protected]>
| * Honor snippet capability in extract function assistsan2021-03-051-2/+8
| |
* | Special-case parenthesized and negated expressions in demorgan assistJesse Bakker2021-03-031-2/+43
| |
* | chore: remove redundant testsConrad Ludgate2021-03-021-30/+0
| |
* | refactor: re-use add_turbo_fish functionConrad Ludgate2021-03-022-199/+137
| |
* | chore: fmt + docsConrad Ludgate2021-03-021-2/+2
| |
* | chore: rename varConrad Ludgate2021-03-021-3/+3
| |
* | feat: add type ascription assistConrad Ludgate2021-03-021-0/+198
| |
* | pull out suggest_name::* to utils; enchance heuristicsVladyslav Katasonov2021-03-021-88/+4
| |
* | suggest parameter name before function nameVladyslav Katasonov2021-03-021-5/+5
| |
* | try to suggest name when extracting variableVladyslav Katasonov2021-03-021-7/+287
| |
* | Merge #7777bors[bot]2021-03-021-0/+419
|\ \ | |/ |/| | | | | | | | | | | 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 <[email protected]>
| * Apply editsJohn Renner2021-03-011-51/+54
| |
| * Implement line<->block comment assistJohn Renner2021-02-251-0/+416
| |
* | Use consistent naming for assistAleksey Kladov2021-02-281-9/+9
| |
* | Don't spam loop-rewriting assistAleksey Kladov2021-02-282-2/+22
| | | | | | | | The more focused the assist, the better!
* | generate try_into instead of intoDomantas Jadenkus2021-02-271-42/+66
| |
* | rename generate_enum_match_method file to match assist nameDomantas Jadenkus2021-02-271-0/+0
| |
* | move into_ and as_ generation to a separate fileDomantas Jadenkus2021-02-272-399/+314
| |
* | cargo fmtDomantas Jadenkus2021-02-271-35/+20
| |
* | add generate_enum_as_method assistDomantas Jadenkus2021-02-271-0/+124
| |
* | deduplicate someDomantas Jadenkus2021-02-271-37/+28
| |
* | add generate_enum_into_method assistDomantas Jadenkus2021-02-271-20/+245
| |
* | make generate_enum_is_method work on any variantsDomantas Jadenkus2021-02-271-18/+95
| |
* | rename existing assist to generate_enum_is_methodDomantas Jadenkus2021-02-271-8/+8
| |
* | 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-241-0/+301
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-231-0/+225
| |/
* | Add tests for apply_demorganLukas Wirth2021-02-241-0/+67
| |
* | De Morgan's Law assist now correctly inverts <, <=, >, >=.lbrande2021-02-243-6/+6
| |
* | De Morgan's Law assist now correctly parenthesizes binary expressions.lbrande2021-02-241-4/+3
|/
* 7526: Rename crate assists to ide_assists.Chetan Khilosiya2021-02-2258-0/+24301