aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists
Commit message (Collapse)AuthorAgeFilesLines
* minor: use minicoreAleksey Kladov2021-06-181-11/+1
|
* internal: add Copy to minicoreAleksey Kladov2021-06-181-302/+409
|
* Merge #9321bors[bot]2021-06-183-165/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9321: Inline generics in const and function trait completions r=Veykril a=RDambrosio016 This PR does a couple of things: - moves path_transform from ide_assists to ide_db to be shared by both assists and completions - when completing a const or a function for a trait, it will "inline" any generics in those associated items instead of leaving the generic's name. For example: ```rust trait Foo<T> { const BAR: T; fn foo() -> T; } struct Bar; impl Foo<u32> for Bar { // autocompletes to this fn foo() -> u32; // and not this (old) fn foo() -> T; // also works for associated consts and where clauses const BAR: u32 = /* */ } ``` Currently this does not work for const generics, because `PathTransform` does not seem to account for them. If this should work on const generics too, `PathTransform` will need to be changed. However, it is uncommon to implement a trait only for a single const value, so this isnt a huge concern. Co-authored-by: rdambrosio <[email protected]>
| * Feat: inline generics in const and func trait completionsrdambrosio2021-06-183-165/+2
| |
* | Minor clippy perf fixesLaurențiu Nicola2021-06-181-2/+2
|/
* minor: simplifyAleksey Kladov2021-06-171-15/+12
|
* internal: add derive and ord support to minicoreAleksey Kladov2021-06-172-48/+67
|
* internal: add From to minicoreAleksey Kladov2021-06-172-50/+99
|
* internal: add default to minicoreAleksey Kladov2021-06-172-49/+75
|
* simplifyLukas Wirth2021-06-171-9/+7
|
* Nest all the or-patterns!Lukas Wirth2021-06-173-26/+32
|
* Merge #9308bors[bot]2021-06-171-13/+52
|\ | | | | | | | | | | | | | | 9308: fix: Create modules in correct directory for nested modules in move_module assist r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * Create modules in correct directory for nested modules in move_module assistLukas Wirth2021-06-171-13/+52
| |
* | internal: switch some tests to minicoreAleksey Kladov2021-06-171-84/+37
| |
* | internal: minimize minicoreAleksey Kladov2021-06-171-53/+25
| | | | | | | | | | | | We want to keep minicore small, so let's split out iterator adapters and sources into a separate `iterators` region, and use them only when needed.
* | internal: cleanup testsAleksey Kladov2021-06-161-71/+114
| |
* | internal: switch some tests to minicoreAleksey Kladov2021-06-161-15/+12
| |
* | internal: switch some tests to minicoreAleksey Kladov2021-06-161-19/+15
|/
* internal: don't #[ignore] testsAleksey Kladov2021-06-152-35/+16
| | | | See the style.md for motivation
* internal: cleanup testsAleksey Kladov2021-06-152-610/+596
| | | | | | * ensure standard, non-indented style (should add this check to `fixture` some day) * removed a couple of ignores
* internal: document that we don't #[ignore] testsAleksey Kladov2021-06-151-16/+16
|
* internal: cut deps between assists and diagnosticsAleksey Kladov2021-06-141-127/+4
|
* internal: prepare to move assist definitionsAleksey Kladov2021-06-142-29/+27
|
* Don't keep a trailing self token in import paths after unmerge_useLukas Wirth2021-06-141-1/+15
|
* Merge #9242bors[bot]2021-06-1322-37/+36
|\ | | | | | | | | | | | | | | 9242: Clippy r=matklad a=Maan2003 Best viewed commit wise Co-authored-by: Maan2003 <[email protected]>
| * cargo fmtMaan20032021-06-131-2/+1
| |
| * clippy::redundant_field_namesMaan20032021-06-131-1/+1
| |
| * clippy::useless_returnMaan20032021-06-131-4/+4
| |
| * clippy::redundant_closureMaan20032021-06-132-3/+3
| |
| * clippy::redudant_borrowMaan20032021-06-1319-28/+28
| |
* | Merge #9240bors[bot]2021-06-131-1/+1
|\ \ | |/ |/| | | | | | | | | | | 9240: Fixed a small typo in comment r=matklad a=fee1-dead Co-authored-by: fee1-dead <[email protected]>
| * Fixed a small typo in commentfee1-dead2021-06-111-1/+1
| |
* | internal: cross-crate cov-marksAleksey Kladov2021-06-121-1/+1
| |
* | Merge #9215bors[bot]2021-06-111-2/+9
|\ \ | |/ |/| | | | | | | | | | | 9215: change visibility for use and macro items r=jonas-schievink a=Maan2003 Co-authored-by: Maan2003 <[email protected]>
| * change visibility for use and macro itemsMaan20032021-06-111-2/+9
| |
* | Don't suggest Remove unused param in trait implsMaan20032021-06-111-1/+29
|/
* fmtJoshua Warner2021-06-061-3/+12
|
* Refactor to be just one assistJoshua Warner2021-06-053-532/+328
|
* Add assist for converting a tuple enum variant to a named variantJoshua Warner2021-06-052-0/+517
|
* Don't inline mutable locals in 'inline_local_variable'Lukas Wirth2021-06-041-0/+17
|
* NFC: remove redundant clones (clippy::perf)Matthias Krüger2021-06-031-1/+1
|
* Preserve indentationJonas Schievink2021-06-021-5/+30
|
* Account for traitsJonas Schievink2021-06-021-10/+29
|
* Merge #9108bors[bot]2021-06-021-2/+31
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9108: Don't show extract into variable assist for unit expressions r=jonas-schievink a=brandondong **Reproduction:** ```rust fn main() { let mut i = 3; $0if i >= 0 { i += 1; } else { i -= 1; }$0 } ``` 1. Select the snippet of code between the $0's. 2. The extract into variable assist shows up, pushing down the more useful extract into function assist. 3. The resulting output of selecting the extract into variable assist is valid but with the extracted variable having the unit type: ```rust fn main() { let mut i = 3; let var_name = if i >= 0 { i += 1; } else { i -= 1; }; var_name } ``` **Fix:** - Don't show the extract into variable assist for unit expressions. I could not think of any scenarios where such a variable extraction would be desired. Co-authored-by: Brandon <[email protected]>
| * Don't show extract into variable assist for unit expressionsBrandon2021-06-021-2/+31
| |
* | Merge #9112bors[bot]2021-06-021-44/+125
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9112: Fix some bugs in `extract_struct_from_enum_variant` assist r=Veykril a=Veykril bors r+ Fixes #9100 Fixes #9099 Kind of fixes #9109, it now copies all the generics might be incorrect if the variant doesn't use all of them) Co-authored-by: Lukas Wirth <[email protected]>
| * | Fix references to patterns in extract_struct_from_enum_variant assistLukas Wirth2021-06-021-26/+51
| | |
| * | Carry over attributes in extract_struct_from_enum_variantLukas Wirth2021-06-021-5/+32
| | |
| * | Account for generics in extract_struct_from_enum_variantLukas Wirth2021-06-021-17/+46
| |/
* / Place extracted type alias outside of implJonas Schievink2021-06-021-1/+27
|/