aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/handlers
Commit message (Collapse)AuthorAgeFilesLines
* Extract function assist will add async if requiredJamie Cunliffe2021-05-171-2/+63
| | | | | The extract function assist will check for an AWAIT_EXPR in the body and if found, will add async to the generated function.
* Merge #8845bors[bot]2021-05-161-12/+275
|\ | | | | | | | | | | | | | | 8845: Generate the impl block via generate_trait_impl_text_from_impl r=Veykril a=hi-rustin Try to close https://github.com/rust-analyzer/rust-analyzer/issues/8827 Co-authored-by: hi-rustin <[email protected]>
| * Remove attrshi-rustin2021-05-151-5/+1
| |
| * Address comments and add more testshi-rustin2021-05-151-25/+249
| | | | | | | | | | | | Fix tests Fmt code
| * Generate the impl block via generate_trait_impl_texthi-rustin2021-05-151-2/+45
| |
* | internal: use standard test styleAleksey Kladov2021-05-161-304/+305
| |
* | internal: use mutable trees when filling match armsAleksey Kladov2021-05-161-8/+20
| |
* | minor: use uniform namesAleksey Kladov2021-05-1611-27/+26
| |
* | Merge #8813bors[bot]2021-05-163-2/+30
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | 8813: Get some more array lengths! r=lf- a=lf- This is built on #8799 and thus contains its changes. I'll rebase it onto master when that one gets merged. It adds support for r-a understanding the length of: * `let a: [u8; 2] = ...` * `let a = b"aaa"` * `let a = [0u8; 4]` I have added support for getting the values of byte strings, which was not previously there. I am least confident in the correctness of this part and it probably needs some more tests, as we currently have only one test that exercised that part (!). Fixes #2922. Co-authored-by: Jade <[email protected]>
| * Add more tests, refactor array lengths/consteval workJade2021-05-141-0/+28
| | | | | | | | | | | | | | | | | | | | | | Fix #2922: add unknown length as a condition for a type having unknown. Incorporate reviews: * Extract some of the const evaluation workings into functions * Add fixmes on the hacks * Add tests for impls on specific array lengths (these work!!! 😁) * Add tests for const generics (indeed we don't support it yet)
| * Support length for ByteStringsJade2021-05-132-2/+2
| | | | | | | | I am not confident that my added byte string parsing is right.
* | internal: use standard style for testsAleksey Kladov2021-05-141-54/+99
| |
* | internal: rewrite assoc item manipulaion to use mutable treesAleksey Kladov2021-05-141-1/+2
| |
* | Merge #8814bors[bot]2021-05-131-5/+33
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 8814: fix: Keep doc comments and outer attrs on "Move module to file" assist r=Veykril a=Jesse-Bakker Fixes #8804 Co-authored-by: Jesse Bakker <[email protected]>
| * | fix: Keep doc comments and outer attrs on "Move module to file" assistJesse Bakker2021-05-131-5/+33
| | |
* | | Merge #8820bors[bot]2021-05-131-0/+26
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8820: fix: Return absolute paths in find_path if crate start is ambiguous r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * | | Return absolute paths in find_path if crate start is ambiguousLukas Wirth2021-05-131-0/+26
| | | |
* | | | Corrected minor typo on line 20mixio2021-05-131-1/+1
| |_|/ |/| |
* | | Merge #8802bors[bot]2021-05-121-9/+126
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | 8802: Keep comments and attrs when extracting struct from enum variant r=Veykril a=DropDemBits Fixes #6730 Still unsure if existing visibilities of fields should be forced to pub (which is what was previously done), or if it's okay to keep it in the extracted struct. Co-authored-by: DropDemBits <[email protected]>
| * | Keep comments and attrs when extracting struct from enum variantDropDemBits2021-05-111-9/+126
| | |
* | | Merge #8800bors[bot]2021-05-111-16/+34
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | 8800: feat: Make "pull assignments up" assist work in more cases r=Jesse-Bakker a=Jesse-Bakker Fixes #8771 Co-authored-by: Jesse Bakker <[email protected]>
| * | Make "pull assignments up" assist work in more casesJesse Bakker2021-05-111-16/+34
| | |
* | | Give MergeBehaviour variants better namesLukas Wirth2021-05-101-2/+2
| |/ |/|
* | simplifyAleksey Kladov2021-05-101-12/+9
| |
* | internal: introduce `ast::make::ext` module with common shortcutsAleksey Kladov2021-05-099-67/+45
| | | | | | | | | | | | | | | | | | | | 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.
* | internal: fix make APIAleksey Kladov2021-05-093-36/+18
| |
* | internal: rewrite **Repalce impl Trait** assist to mutable syntax treesAleksey Kladov2021-05-091-11/+13
| |
* | cleanupsAleksey Kladov2021-05-092-2/+2
| |
* | cleanupsAleksey Kladov2021-05-092-14/+14
| |
* | minor: fix test styleAleksey Kladov2021-05-091-55/+31
| |
* | Merge #8773bors[bot]2021-05-081-1/+1
|\ \ | |/ |/| | | | | | | | | | | 8773: fix: Correctly support SelfType when searching for usages r=Veykril a=Veykril Fixes #7443 Co-authored-by: Lukas Wirth <[email protected]>
| * Correctly support SelfType when searching for usagesLukas Wirth2021-05-081-1/+1
| |
* | feat: add "mentoring instructions" test for pull up assistAleksey Kladov2021-05-081-1/+32
| |
* | internal: pull_assignment_up uses mutable treesAleksey Kladov2021-05-081-69/+68
| |
* | minor: add missing testAleksey Kladov2021-05-081-16/+36
|/
* internal: remove one more usage of SyntaxRewriterAleksey Kladov2021-05-081-56/+46
|
* internal: remove one more syntax rewriterAleksey Kladov2021-05-081-57/+33
|
* internal: remove one more usage of the rewriterAleksey Kladov2021-05-041-10/+23
|
* Don't mutate the tree while traversing in reorder_implLukas Tobias Wirth2021-05-031-4/+36
|
* internal: fix naming polarityAleksey Kladov2021-04-301-1/+1
| | | | | Type Constructors have *parameters*, when they are substituted with type *arguments*, we have a type.
* internal: normalize nameAleksey Kladov2021-04-301-1/+1
| | | | All def types in hir are unsubstituted
* Split out merge_imports module from helpers::insert_useLukas Wirth2021-04-241-1/+1
|
* Merge #8591 #8638bors[bot]2021-04-235-137/+143
|\ | | | | | | | | | | | | | | | | | | | | | | 8591: Remove SyntaxRewriter usage in insert_use in favor of mutable syntax trees r=matklad a=Veykril Unfortunately changing `insert_use` to not use `SyntaxRewriter` creates a lot of changes since so much relies on that. But on the other hand this should be the biggest usage of `SyntaxRewriter` I believe. 8638: Remove SyntaxRewriter::from_fn r=Veykril a=Veykril Co-authored-by: Lukas Wirth <[email protected]>
* \ Merge #8317bors[bot]2021-04-231-0/+516
|\ \ | | | | | | | | | | | | | | | | | | | | | 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 missing test case for "Convert to named struct" assistunexge2021-04-231-0/+40
| | |
| * | Stop iterating reference after made an edit in "Convert to named struct" assistunexge2021-04-231-2/+47
| | |
| * | Move reference editing logic into own function to make error handling more ↵unexge2021-04-221-68/+61
| | | | | | | | | | | | ease in "Convert to named struct" assist
| * | Add multi file test for "Convert to named struct" assistunexge2021-04-211-0/+33
| | |
| * | Remove `unwrap`s in "Convert to named struct" assistunexge2021-04-211-9/+19
| | |
| * | Add larger example for "Convert to named struct" assistunexge2021-04-211-4/+30
| | |