about summary refs log tree commit diff
path: root/crates/syntax/src
AgeCommit message (Collapse)AuthorLines
2022-07-08Update remaining GitHub URLsJonas Schievink-4/+4
2022-07-01fix: Simplify macro statement expansion handlingLukas Wirth-0/+7
2022-06-10internal: Bump DependenciesLukas Wirth-1/+1
2022-05-26fix: f32 and f64 representation during loweringfeniljain-5/+37
2022-05-24fix: Insert whitespace into trait-impl completions when coming from macrosLukas Wirth-52/+0
2022-05-24internal: Refactor our record pat/expr handling in completion contextLukas Wirth-0/+4
2022-05-23fix: When reference searching macro inputs, don't search everything that was ↵Lukas Wirth-0/+7
downmapped
2022-05-14feat: Add binding mode inlay hintsLukas Wirth-1/+1
2022-05-13Revert "Auto merge of #12149 - jonas-schievink:literally-just-a-literal, ↵Jonas Schievink-126/+36
r=jonas-schievink" This reverts commit cc9ae2b89e01a30e441371b9fd3376c3d03a475f, reversing changes made to 7dfd1cb572d8d4fd951237361e43ecddd9c9a852.
2022-05-05Indicate the number of float tokens in the first tokenJonas Schievink-2/+24
2022-05-05Split float literal tokens at the `.`Jonas Schievink-12/+15
2022-05-05Wrap float literals in their own nodeJonas Schievink-21/+78
2022-05-05Remove `ast::Literal::token`Jonas Schievink-8/+16
2022-05-05Lower values of char and byte literalsLaurențiu Nicola-8/+86
2022-05-04improve the default constructor mode when filling fieldsBenjamin Coenen-0/+3
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2022-04-27Auto merge of #12057 - harpsword:fix_validata_visibility, r=jonas-schievinkbors-2/+4
fix visibility token validation in trait impl with proc-macro fix #11828
2022-04-27fix visibility token validation in trait impl with proc-macroharpsword-2/+4
2022-04-23SimplifyLukas Wirth-0/+6
2022-04-17update grammer to support associated const equalityXFFXFF-0/+1
2022-04-10Parse for<'a> closure syntaxLukas Wirth-0/+2
2022-04-05Wrap macros in expr position in `MacroExpr` nodeJonas Schievink-6/+31
2022-04-03Merge #11887bors[bot]-0/+47
11887: fix: Add missing fields diagnostic fix for patterns r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-03fix: Add missing fields diagnostic fix for patternsLukas Wirth-0/+47
2022-04-02Merge #11877bors[bot]-3/+20
11877: fix: splitting path of a glob import wrongly adds `self` r=Veykril a=iDawer Close #11703 `ast::UseTree::split_prefix` handles globs now. Removed an extra branch for globs in `ide_db::imports::merge_imports::recursive_merge` (superseeded by split_prefix). Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2022-04-02fix: `merge_imports::recursive_merge` exiting earlyiDawer-1/+1
2022-04-01internal: Move rust.ungram into rust-analyzer/crates/syntaxLukas Wirth-2/+3
2022-04-01fix: splitting path of a glob import wrongly adds `self`iDawer-3/+20
`ast::UseTree::split_prefix` handles globs now. Removed an extra branch for globs in `ide_db::imports::merge_imports::recursive_merge` (superseeded by split_prefix).
2022-03-20Merge #11690bors[bot]-0/+9
11690: feat: Add an assist for inlining type aliases r=Veykril a=steven-joruk I'm working towards implementing #10881, but I'd like to get this in first with earlier feedback. Is `inline_type_alias` a good enough name? I guess the follow up assist would be called `inline_type_alias_into_all_users` based on that. ![valid_inlines](https://user-images.githubusercontent.com/1277939/158020510-fed78b5c-4c7e-46d1-9151-3044a29b9990.gif) ![invalid_inlines](https://user-images.githubusercontent.com/1277939/158020516-8a2deb6d-c6ec-4adf-a15b-c514fc97dc43.gif) Co-authored-by: Steven Joruk <steven@joruk.com>
2022-03-12fix: "Extract to function" assist preserves `break` and `continue` labelsMorgan Thomas-6/+16
Adds a label / lifetime parameter to `ide_assists::handlers::extract_function::FlowKind::{Break, Continue}`, adds support for emitting labels to `syntax::ast::make::{expr_break, expr_continue}`, and implements the required machinery to let `extract_function` make use of them. This does modify the external API of the `syntax` crate, but the changes there are simple, not used outside `ide_assists`, and, well, we should probably support emitting `break` and `continue` labels through `syntax` anyways, they're part of the language spec. Closes #11413.
2022-03-12more clippy fixes:Matthias Krüger-3/+1
clippy::search_is_some clippy::redundant_static_lifetimes clippy::match_single_binding clippy::match_ref_pats clippy::map_entry clippy::manual_map clippy::iter_overeager_cloned clippy::into_iter_on_ref clippy::extra_unused_lifetimes
2022-03-12fix clippy::redundant_closureMatthias Krüger-1/+1
2022-03-12fix clippy::single_char_patternMatthias Krüger-1/+1
2022-03-12feat: Add an assist for inlining type aliasesSteven Joruk-0/+9
This intends to lead to a more useful assist to replace all users of an alias with its definition.
2022-03-10Don't parse source files to generate macro completion detailsLukas Wirth-35/+1
2022-03-06Highlight `Self` as a keyword by defaultLukas Wirth-5/+9
2022-03-05fix: Recognize `Self` as a proper keywordLukas Wirth-16/+29
2022-03-05Merge #11598bors[bot]-1/+35
11598: feat: Parse destructuring assignment r=Veykril a=ChayimFriedman2 Part of #11532. Lowering is not as easy and may not even be feasible right now as it requires generating identifiers: `(a, b) = (b, a)` is desugared into ```rust { let (<gensym_a>, <gensym_b>) = (b, a); a = <gensym_a>; b = <gensym_b>; } ``` rustc uses hygiene to implement that, but we don't support hygiene yet. However, I think parsing was the main problem as lowering will just affect type inference, and while `{unknown}` is not nice it's much better than a syntax error. I'm still looking for the best way to do lowering, though. Fixes #11454. Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
2022-03-04Preserve order of generic argshkalbasi-10/+20
2022-03-02Parse destructuring assignmentChayim Refael Friedman-1/+34
The only patterns we should parse are `..` in structs and `_`: the rest are either not supported or already valid expressions.
2022-02-27Fix `if` in #11561Chayim Refael Friedman-5/+61
2022-02-26Fix body selection in while loopsLaurențiu Nicola-3/+12
2022-02-25Generate AST code after rust-analyzer/ungrammar#46Chayim Refael Friedman-0/+1
2022-02-24fix(11422): have two different funuctions - one for iterating breaks, one ↵Moritz Vetter-3/+4
for iteraating breaks and continues
2022-02-22Make replace_derive_with_manual_impl work againLukas Wirth-0/+9
2022-02-21Change `single_let()` and `is_pattern_cond()` to free functionsChayim Refael Friedman-36/+0
2022-02-21Validate `let` expressionsChayim Refael Friedman-0/+31
Emit an error if they're found in an invalid position.
2022-02-21Parse `let` expressions in order to support `let` chainsChayim Refael Friedman-46/+75
We still need to reject freestanding `let` expressions: see https://github.com/rust-analyzer/rust-analyzer/issues/11320#issuecomment-1018212465.
2022-02-03Move attribute path completions into attribute completion moduleLukas Wirth-1/+1
2022-02-01Merge #11322bors[bot]-0/+25
11322: Extract function also extracts comments r=Vannevelj a=Vannevelj Fixes #9011 The difficulty I came across is that the original assist works from the concept of a `ast::StmtList`, a node, but that does not allow me to (easily) represent comments, which are tokens. To combat this, I do a whole bunch of roundtrips: from the `ast::StmtList` I retrieve the `NodeOrToken`s it encompasses. I then cast all `Node` ones back to a `Stmt` so I can apply indentation to it, after which it is again parsed as a `NodeOrToken`. Lastly, I add a new `make::` api that accepts `NodeOrToken` rather than `StmtList` so we can write the comment tokens. Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2022-01-31Make more precise range macro upmappingLukas Wirth-2/+2