aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/tests
Commit message (Collapse)AuthorAgeFilesLines
* minor: use minicoreAleksey Kladov2021-06-181-18/+9
|
* tidyDomantas Jadenkus2021-05-241-2/+2
|
* feat: generate getter avoids generating types like `&Vec<T>`Aleksey Kladov2021-05-231-2/+2
|
* feat: generate getter assist places the cursor at the generated functionAleksey Kladov2021-05-231-2/+2
|
* internal: rewrite assoc item manipulaion to use mutable treesAleksey Kladov2021-05-141-1/+0
|
* internal: introduce `ast::make::ext` module with common shortcutsAleksey Kladov2021-05-091-1/+1
| | | | | | | | | | There's a tension between keeping a well-architectured minimal orthogonal set of constructs, and providing convenience functions. Relieve this pressure by introducing an dedicated module for non-orthogonal shortcuts. This is inspired by the django.shortcuts module which serves a similar purpose architecturally.
* Merge #8317bors[bot]2021-04-231-0/+41
|\ | | | | | | | | | | | | | | 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 <[email protected]>
| * Add larger example for "Convert to named struct" assistunexge2021-04-211-4/+30
| |
| * Add convert tuple struct to named struct assistunexge2021-04-041-0/+15
| |
* | Adds impl Deref assistjake2021-04-111-0/+27
|/
* Convert Into to From assistGraeme Coupar2021-04-031-0/+32
| | | | | | | | | | | | 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.
* Don't use snippetsJonas Schievink2021-03-291-2/+2
|
* Snippet support in extract_type_aliasJonas Schievink2021-03-271-2/+2
|
* Implement "Extract type alias" assistJonas Schievink2021-03-261-0/+19
|
* 7709: Updated the implementation.Chetan Khilosiya2021-03-151-0/+4
| | | | | The get function from impl method is updated. and now same method used to get len and is_empty function.
* 7709: Added the assist to generate is_empty functionChetan Khilosiya2021-03-151-0/+25
| | | | | the assist will be shown when the len function is implemented. is_empty internally uses len function.
* Fix convert_iter_for_each_to_for doctestLukas Wirth2021-03-121-4/+11
|
* fix: generated test fixtureLuiz Carlos MourĂ£o Paes de Carvalho2021-03-121-0/+23
|
* 7708: Fixed many documentaion example issues.Chetan Khilosiya2021-03-061-0/+31
|
* Use consistent naming for assistAleksey Kladov2021-02-281-23/+23
|
* generate try_into instead of intoDomantas Jadenkus2021-02-271-29/+29
|
* add generate_enum_as_method assistDomantas Jadenkus2021-02-271-0/+29
|
* add generate_enum_into_method assistDomantas Jadenkus2021-02-271-0/+29
|
* rename existing assist to generate_enum_is_methodDomantas Jadenkus2021-02-271-2/+2
|
* Merge #7741bors[bot]2021-02-241-0/+23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
| * Add convert_for_to_iter_for_each assistMatt Hall2021-02-231-0/+23
| |
* | De Morgan's Law assist now correctly inverts <, <=, >, >=.lbrande2021-02-241-2/+2
| |
* | De Morgan's Law assist now correctly parenthesizes binary expressions.lbrande2021-02-241-2/+2
|/
* 7526: Rename crate assists to ide_assists.Chetan Khilosiya2021-02-221-0/+1329