Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Use arrayvec 0.6 | Laurențiu Nicola | 2021-03-25 | 1 | -8/+8 |
| | |||||
* | Simplify code | Aleksey Kladov | 2021-03-23 | 1 | -2/+3 |
| | | | | changelog: skip | ||||
* | rewrite merge use trees assist to use muatable syntax trees | Aleksey Kladov | 2021-03-22 | 4 | -46/+74 |
| | | | | changelog internal | ||||
* | a lot of clippy::style fixes | Matthias Krüger | 2021-03-21 | 6 | -44/+32 |
| | |||||
* | clippy::complexity simplifications related to Iterators | Matthias Krüger | 2021-03-21 | 1 | -2/+1 |
| | |||||
* | use strip_prefix() instead of starts_with and slicing (clippy::manual_strip) | Matthias Krüger | 2021-03-21 | 1 | -2/+1 |
| | |||||
* | remove more redundant clones (clippy::redundant_clone()) | Matthias Krüger | 2021-03-21 | 2 | -3/+3 |
| | |||||
* | Don't use an untyped String for ActiveParam tracking | Lukas Wirth | 2021-03-20 | 1 | -0/+9 |
| | |||||
* | Move `AttrsOwnerNode` to syntax and make it public | Jonas Schievink | 2021-03-19 | 2 | -2/+32 |
| | |||||
* | Make ast editing more ergonomic | Aleksey Kladov | 2021-03-19 | 2 | -40/+66 |
| | | | | changelog internal | ||||
* | Parse extended_key_value_attributes | Lukas Wirth | 2021-03-19 | 2 | -33/+23 |
| | |||||
* | Better handling of block doc comments | Lukas Wirth | 2021-03-17 | 3 | -35/+29 |
| | |||||
* | Merge #8059 | bors[bot] | 2021-03-17 | 1 | -1/+1 |
|\ | | | | | | | | | | | | | | | 8059: Move doc-comment highlight injection from AST to HIR r=matklad,jonas-schievink a=Veykril Fixes #5016 Co-authored-by: Lukas Wirth <[email protected]> | ||||
| * | Replace trait object boxing with extra AttrsOwnerNode | Lukas Wirth | 2021-03-16 | 1 | -1/+1 |
| | | |||||
* | | avoid converting types into themselves via .into() (clippy::useless-conversion) | Matthias Krüger | 2021-03-17 | 2 | -2/+2 |
| | | | | | | | | example: let x: String = String::from("hello world").into(); | ||||
* | | pit-of-successify tree editor | Aleksey Kladov | 2021-03-16 | 2 | -14/+17 |
| | | |||||
* | | Auto-magical whitespace | Aleksey Kladov | 2021-03-16 | 2 | -23/+58 |
| | | |||||
* | | Move more bounds | Aleksey Kladov | 2021-03-16 | 1 | -10/+44 |
|/ | | | | changelog: skip | ||||
* | Upgrade rowan | Aleksey Kladov | 2021-03-16 | 8 | -25/+225 |
| | | | | Notably, new rowan comes with support for mutable syntax trees. | ||||
* | Fix macro expansion for statements w/o semicolon | Edwin Cheng | 2021-03-16 | 1 | -2/+8 |
| | |||||
* | Attach trivia to ast::Union nodes | Lukas Wirth | 2021-03-14 | 1 | -2/+2 |
| | |||||
* | feat: add expr_for_loop to make in syntax | Luiz Carlos Mourão Paes de Carvalho | 2021-03-10 | 1 | -0/+3 |
| | |||||
* | Better strip turbofishes | Kirill Bulatov | 2021-03-08 | 3 | -0/+48 |
| | |||||
* | Use upstream cov-mark | Laurențiu Nicola | 2021-03-08 | 1 | -14/+12 |
| | |||||
* | Use the same name in xtask and test utils | Aleksey Kladov | 2021-03-08 | 1 | -3/+3 |
| | |||||
* | Merge #7777 | bors[bot] | 2021-03-02 | 2 | -5/+9 |
|\ | | | | | | | | | | | | | | | 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]> | ||||
| * | Implement line<->block comment assist | John Renner | 2021-02-25 | 2 | -5/+9 |
| | | |||||
* | | Add tests for apply_demorgan | Lukas Wirth | 2021-02-24 | 1 | -2/+5 |
|/ | |||||
* | Fix incorrect missing field diagnostic with box patterns | Laurențiu Nicola | 2021-02-20 | 1 | -4/+13 |
| | |||||
* | Revert "Replace usage of ast::NameOrNameRef with ast::NameLike" | Lukas Wirth | 2021-02-17 | 2 | -18/+23 |
| | | | | This reverts commit e1dbf43cf85f84c3a7e40f9731fc1f7ac96f8979. | ||||
* | Replace usage of ast::NameOrNameRef with ast::NameLike | Lukas Wirth | 2021-02-17 | 2 | -23/+18 |
| | |||||
* | Implement ast::AstNode for NameLike and move it to node_ext | Lukas Wirth | 2021-02-16 | 2 | -1/+47 |
| | |||||
* | Merge #7620 | bors[bot] | 2021-02-16 | 1 | -9/+50 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7620: Support control flow in `extract_function` assist r=matklad a=cpud36 Support `return`ing from outer function, `break`ing and `continue`ing outer loops when extracting function. # Example Transforms ```rust fn foo() -> i32 { let items = [1,2,3]; let mut sum = 0; for &item in items { <|>if item == 42 { break; }<|> sum += item; } sum } ``` Into ```rust fn foo() -> i32 { let items = [1,2,3]; let mut sum = 0; for &item in items { if fun_name(item) { break; } sum += item; } sum } fn fun_name(item: i32) -> bool { if item == 42 { return true; } false } ``` ![add_explicit_type_infer_type](https://user-images.githubusercontent.com/4218373/107544222-0fadf280-6bdb-11eb-9625-ed6194ba92c0.gif) # Features Supported variants - break and function does not return => uses `bool` and plain if - break and function does return => uses `Option<T>` and matches on it - break with value and function does not return => uses `Option<T>` and if let - break with value and function does return => uses `Result<T, U>` and matches on t - same for `return` and `continue`(but we can't continue with value) Assist does handle nested loops and nested items(like functions, modules, impls) Try `expr?` operator is allowed together with `return Err(_)` and `return None`. `return expr` is not allowed. # Not supported ## Mixing `return` with `break` or `continue` If we have e.g. a `return` and a `break` in the selected code, it is unclear what the produced code should look like. We can try `Result<T, Option<U>>` or something like that, but it isn't idiomatic, nor it is established. Otherwise, implementation is relatively simple. ## `break` with label Not sure how to handle different labels for multiple `break`s. [edit] implemented try `expr?` Co-authored-by: Vladyslav Katasonov <[email protected]> | ||||
| * | allow try expr? when extacting function | Vladyslav Katasonov | 2021-02-13 | 1 | -0/+3 |
| | | |||||
| * | handle return, break and continue when extracting function | Vladyslav Katasonov | 2021-02-13 | 1 | -9/+47 |
| | | |||||
* | | Don't rename field record patterns directly | Lukas Wirth | 2021-02-13 | 1 | -3/+2 |
|/ | |||||
* | Refactor reference searching to work with the ast | Lukas Wirth | 2021-02-12 | 1 | -4/+26 |
| | |||||
* | Add parsing benchmark | Aleksey Kladov | 2021-02-09 | 1 | -3/+25 |
| | |||||
* | AdtDef -> Adt | Aleksey Kladov | 2021-02-07 | 1 | -19/+19 |
| | |||||
* | allow modifications of vars from outer scope inside extracted function | Vladyslav Katasonov | 2021-02-03 | 1 | -1/+1 |
| | | | | | It currently allows only directly setting variable. No `&mut` references or methods. | ||||
* | Fix ast::String::value not properly escaping in some cases | Lukas Wirth | 2021-01-30 | 1 | -2/+19 |
| | |||||
* | Add validation for mutable const items | Lukas Wirth | 2021-01-24 | 1 | -1/+15 |
| | |||||
* | :arrow_up: rowan | Aleksey Kladov | 2021-01-20 | 4 | -8/+7 |
| | | | | It now stores text inline with tokens | ||||
* | . | Aleksey Kladov | 2021-01-19 | 5 | -17/+17 |
| | |||||
* | :arrow_up: rowan | Aleksey Kladov | 2021-01-19 | 2 | -4/+5 |
| | |||||
* | Add `MacroType` syntax | Jonas Schievink | 2021-01-18 | 1 | -2/+31 |
| | |||||
* | Merge #7291 | bors[bot] | 2021-01-18 | 2 | -15/+25 |
|\ | | | | | | | | | | | | | | | 7291: Wrap remaining self/super/crate in Name{Ref} r=matklad a=Veykril That should be the remaining special casing for `self` 🎉 Co-authored-by: Lukas Wirth <[email protected]> | ||||
| * | Wrap remaining self/super/crate in Name{Ref} | Lukas Wirth | 2021-01-15 | 2 | -15/+25 |
| | | |||||
* | | Add Unmerge Use assist | unexge | 2021-01-15 | 1 | -2/+6 |
|/ | |||||
* | Merge #7288 | bors[bot] | 2021-01-15 | 4 | -9/+23 |
|\ | | | | | | | | | | | | | | | | | | | 7288: Handle self/super/crate in PathSegment as NameRef r=matklad a=Veykril Wrapping self/super/crate in NameRef as per https://github.com/rust-analyzer/rust-analyzer/pull/7261#issuecomment-760023172 Co-authored-by: Lukas Wirth <[email protected]> |