about summary refs log tree commit diff
path: root/crates/syntax/src
AgeCommit message (Collapse)AuthorLines
2021-11-11Fix `impl_trait` function to emit correct astTheDoctor314-8/+64
`impl_trait` code copied from `generate_impl_text_inner` to properly handle the bounds for the generic parameters.
2021-11-10Add generic parameters for manual impl assistTheDoctor314-2/+7
The `impl_trait` function takes an optional `GenericParamList` to create the trait impl.
2021-10-30Fix for-loop expressions breaking with BlockExpr iterableLukas Wirth-5/+20
2021-10-28Refactor ide handling for paths in derive inputsLukas Wirth-1/+22
2021-10-23internal: remove unused dollarsAleksey Kladov-10/+1
2021-10-22Merge #9939bors[bot]-0/+6
9939: feat: Adding extract_module assist r=Veykril a=feniljain Should solve https://github.com/rust-analyzer/rust-analyzer/issues/9591 Co-authored-by: vi_mi <fenil.jain2018@vitstudent.ac.in> Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-21Migrate to edition 2021Lukas Wirth-6/+1
2021-10-19internal: Parse const trait boundsLukas Wirth-0/+3
2021-10-16feat: Adding extract_module assistvi_mi-0/+6
2021-10-14Merge #10546bors[bot]-0/+13
10546: feat: Implement promote_local_to_const assist r=Veykril a=Veykril Fixes #7692, that is now one can invoke the `extract_variable` assist on something and then follow that up with this assist to turn it into a const. bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-14Implement promotoe_local_to_const assistLukas Wirth-0/+13
2021-10-14Enable delegation generation for complex typesYoshua Wuyts-3/+24
2021-10-13Add basic support for delegationRyan Levick-0/+4
2021-10-12Make selections in assists with trailing/leading whitespace more forgivingLukas Wirth-0/+10
2021-10-10Merge #10506bors[bot]-0/+1
10506: Add comment r=lnicola a=k-nasa ## Why This code looks logic-bug ... https://github.com/rust-analyzer/rust-analyzer/blob/ce86534e1cb22685e83c3f91ea89025edbfcbc98/crates/syntax/src/syntax_node.rs#L50 However, this code has been intentionally disabled. It's a good idea to write a comment ref: https://github.com/rust-analyzer/rust-analyzer/pull/10357 ## What - I added comment Co-authored-by: k-nasa <htilcs1115@gmail.com>
2021-10-10Add commentk-nasa-0/+1
2021-10-10Merge #10504bors[bot]-1/+1
10504: Remove needless clone r=lnicola a=k-nasa ## Why Delete clones for efficiency ## What - I erased unnecessary clones Co-authored-by: k-nasa <htilcs1115@gmail.com>
2021-10-10remove commentk-nasa-2/+0
2021-10-10Revert "update comment"k-nasa-1/+1
This reverts commit 820393f72d68c6bf1df125057296402ba83ca982.
2021-10-10Remove neesless clonek-nasa-1/+1
2021-10-10update commentk-nasa-1/+1
2021-10-10Add code commentk-nasa-0/+2
2021-10-09internal: make sure macro test expand to valid syntaxAleksey Kladov-4/+3
2021-10-07Support `let...else`Jonas Schievink-0/+27
2021-10-06Merge #10420bors[bot]-1/+3
10420: Parse outer attributes on StructPatternEtCetera r=jonas-schievink a=XFFXFF Try to fix https://github.com/rust-analyzer/rust-analyzer/issues/8610 Related pr in ungrammer: https://github.com/rust-analyzer/ungrammar/pull/41 Co-authored-by: zhoufan <1247714429@qq.com>
2021-10-05Merge #10440bors[bot]-105/+98
10440: Fix Clippy warnings and replace some `if let`s with `match` r=Veykril a=arzg I decided to try fixing a bunch of Clippy warnings. I am aware of this project’s opinion of Clippy (I have read both [rust-lang/clippy#5537](https://github.com/rust-lang/rust-clippy/issues/5537) and [rust-analyzer/rowan#57 (comment)](https://github.com/rust-analyzer/rowan/pull/57#discussion_r415676159)), so I totally understand if part of or the entirety of this PR is rejected. In particular, I can see how the semicolons and `if let` vs `match` commits provide comparatively little benefit when compared to the ensuing churn. I tried to separate each kind of change into its own commit to make it easier to discard certain changes. I also only applied Clippy suggestions where I thought they provided a definite improvement to the code (apart from semicolons, which is IMO more of a formatting/consistency question than a linting question). In the end I accumulated a list of 28 Clippy lints I ignored entirely. Sidenote: I should really have asked about this on Zulip before going through all 1,555 `if let`s in the codebase to decide which ones definitely look better as `match` :P Co-authored-by: Aramis Razzaghipour <aramisnoah@gmail.com>
2021-10-05Replace `if let` with `match` where appropriateAramis Razzaghipour-39/+34
2021-10-05Replace `if let Some(_) = foo` with `if foo.is_some()`Aramis Razzaghipour-1/+1
2021-10-03Fix miscellaneous Clippy lintsAramis Razzaghipour-20/+18
2021-10-03Add semicolons for consistencyAramis Razzaghipour-45/+45
`clippy::semicolon_if_nothing_returned`
2021-10-03Merge #10438bors[bot]-2/+40
10438: minor: Simplify r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-03minor: SimplifyLukas Wirth-2/+40
2021-10-03fix: await insertion with try_expr during extract_functionvi_mi-0/+3
2021-10-02minor: dead codeAleksey Kladov-8/+1
2021-10-02internal: remove deprecated methodAleksey Kladov-3/+0
2021-10-02minor: regenAleksey Kladov-0/+149
2021-10-02minor: generated code readabilityAleksey Kladov-1/+2
2021-10-02Parse outer attributes on StructPatternEtCeterazhoufan-1/+3
2021-09-28Fix inline_call breaking RecordExprField shorthandsLukas Wirth-0/+29
2021-09-27Rename `*Owner` traits to `Has*`Lukas Wirth-240/+240
2021-09-27Rename `Dyn*` nodes to `Any*` nodesLukas Wirth-61/+61
2021-09-26internal: more reasonable grammar for blocksAleksey Kladov-90/+79
Consider these expples { 92 } async { 92 } 'a: { 92 } #[a] { 92 } Previously the tree for them were BLOCK_EXPR { ... } EFFECT_EXPR async BLOCK_EXPR { ... } EFFECT_EXPR 'a: BLOCK_EXPR { ... } BLOCK_EXPR #[a] { ... } As you see, it gets progressively worse :) The last two items are especially odd. The last one even violates the balanced curleys invariant we have (#10357) The new approach is to say that the stuff in `{}` is stmt_list, and the block is stmt_list + optional modifiers BLOCK_EXPR STMT_LIST { ... } BLOCK_EXPR async STMT_LIST { ... } BLOCK_EXPR 'a: STMT_LIST { ... } BLOCK_EXPR #[a] STMT_LIST { ... }
2021-09-26Merge #10358bors[bot]-220/+15
10358: internal: Remove inherent methods from ast nodes that do non-syntactic complex tasks r=Veykril a=Veykril Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-26Remove inherent methods from ast node that carry semantic meaningLukas Wirth-220/+15
2021-09-26internal: fix and force-disable block validation ;-(Aleksey Kladov-8/+5
Originally we tried to maintain the invariant that `{}` always match. That is, that in the parse tree the pair of corresponding `{}` is always first and last tokens of some nodes. We had the code to validate that, but apparently it's been broken for **years** since we introduced tokens/nodes split. Fixing it now makes some tests fail. It's unclear if we want to keep this invariant: there's a strong motivation for breaking it in the following case: ``` use std::{ // unclosed paren fn main() { } } // don't actually want to pair up this with the one from `use` ``` So let's fix the code, but disable it for the time being
2021-09-25Merge #10346bors[bot]-33/+35
10346: minor: align code with code-style r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-25minor: align code with code-styleAleksey Kladov-33/+35
2021-09-25minore: improve consistencyAleksey Kladov-8/+8
2021-09-23CleanupLukas Wirth-0/+10
2021-09-21SimplifyLukas Wirth-110/+9