about summary refs log tree commit diff
path: root/crates/syntax/src/ast
AgeCommit message (Collapse)AuthorLines
2021-01-02Fix warnings on rust-nightlycynecx-2/+2
2020-12-29indentationAdnoC-3/+3
2020-12-29Smarter bracketed use diagnosticAdnoC-0/+8
2020-12-23Implement const block inferenceLukas Wirth-0/+4
2020-12-23Merge #7010bors[bot]-1/+32
7010: Update ungrammar for const block patterns r=matklad a=Veykril Fixes #6848 Adds const blocks and const block patterns to the AST and parses them. Blocked on https://github.com/rust-analyzer/ungrammar/pull/17/, will merge that PR there once this one gets the OK so I can remove the local ungrammar dependency path and fix the Cargo.lock. Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-23Document `make` module designAleksey Kladov-1/+7
2020-12-23Update ungrammar for const block patternsLukas Wirth-1/+32
2020-12-18Minor, cleanup APIAleksey Kladov-0/+3
2020-12-16Merge #6896bors[bot]-30/+44
6896: Node-ify lifetimes r=jonas-schievink a=Veykril Let's see if this passes the tests 🤞 Depends on https://github.com/rust-analyzer/ungrammar/pull/15 Co-authored-by: Jonas Schievink <jonasschievink@gmail.com> Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com> Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-16Merge #6897bors[bot]-1/+89
6897: Basic support for macros 2.0 r=jonas-schievink a=jonas-schievink This adds support for (built-in-only) macros 2.0, and removes some hacks used for builtin derives, which are declared via macros 2.0 in libcore. First steps for https://github.com/rust-analyzer/rust-analyzer/issues/2248. Blocked on https://github.com/rust-analyzer/ungrammar/pull/16. Co-authored-by: Jonas Schievink <jonasschievink@gmail.com> Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-12-16Node-ify lifetimesLukas Wirth-30/+44
2020-12-16Merge #6894bors[bot]-0/+3
6894: Parenthesize composite if condition before inverting in invert-if assist r=matklad a=Jesse-Bakker Fixes #6867 Co-authored-by: Jesse Bakker <github@jessebakker.com>
2020-12-15Basic support for decl macros 2.0Jonas Schievink-1/+89
2020-12-15Parenthesize composite if condition before inverting in invert-if assistJesse Bakker-0/+3
2020-12-15Move to upstream `macro_rules!` modelJonas Schievink-21/+39
2020-12-12Remove some redundant allocationsJeremy Kolb-2/+2
2020-12-09Properly fetch inner and outer docs on hir-levelLukas Wirth-0/+8
2020-12-08Simplify ast::Comment api surfaceLukas Wirth-10/+15
2020-12-07Keep doc attribute orderLukas Wirth-41/+35
2020-12-07Merge #6719bors[bot]-0/+1
6719: Use items can also have doc comments r=matklad a=Veykril Prior to this change modules show more docs than they have cause they inherit the docs from documented use items inside of them. Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-05Add replace_match_with_if_let assistLukas Wirth-2/+11
2020-12-04Use items can also have doc commentsLukas Wirth-0/+1
2020-12-02Merge #6649bors[bot]-22/+55
6649: Accept more than just the standard rust literal suffixes in *Number::suffix r=matklad a=Veykril I am not entirely sure whether to keep or remove the `SUFFIXES` but I figured we can always bring them back once they are needed. Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-28Add ast::*Number::suffix tests unit testsLukas Wirth-0/+37
2020-11-27Avoid allocation in ast::String::value if the string needs no unescapingLukas Wirth-9/+18
2020-11-27Accept more than just the standard rust literal suffixes in *Number::suffixLukas Wirth-22/+18
2020-11-16Merge #6558bors[bot]-0/+22
6558: format string highlighting: handle hex + debug type specifier r=matklad a=ruabmbua Should fix https://github.com/rust-analyzer/rust-analyzer/issues/6427 Co-authored-by: Roland Ruckerbauer <roland.rucky@gmail.com>
2020-11-15format string highlighting: handle hex + debug type specifierRoland Ruckerbauer-0/+22
2020-11-14Use shorthand record syntax when renaming struct initializer fieldLukas Wirth-9/+13
2020-11-12Simplify codeAleksey Kladov-28/+23
2020-11-07Merge #6476bors[bot]-0/+4
6476: Add missing AssocItems in add_custom_impl assist r=matklad a=Veykril ```rust use std::fmt; #[derive(Debu<|>g)] struct Foo { bar: String, } ``` -> ```rust use std::fmt; struct Foo { bar: String, } impl fmt::Debug for Foo { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ${0:todo!()} } } ``` Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-06Cleanup APIAleksey Kladov-57/+39
2020-11-06SimplifyAleksey Kladov-34/+22
2020-11-06Kill RAW_ literalsAleksey Kladov-44/+35
Syntactically, they are indistinguishable from non-raw versions, so it doesn't make sense to separate then *at the syntax* level.
2020-11-06More orthogonal APIAleksey Kladov-33/+30
2020-11-06Move int parsing to IntNumber tokenAleksey Kladov-75/+90
2020-11-06Better importsAleksey Kladov-11/+11
2020-11-06Generate token for ints and floatsAleksey Kladov-0/+42
2020-11-05Add missing AssocItems in add_custom_impl assistLukas Wirth-0/+4
2020-11-04Merge #6456bors[bot]-2/+25
6456: Support record variants in extract_struct_from_enum_variant r=matklad a=Veykril As requested :) This also prevents the assist from being disabled if a definition in the value namespace exists with the same name as our new struct since that won't cause a collision #4468 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-11-03Support struct variants in extract_struct_from_enum_variantLukas Wirth-2/+25
2020-11-03Merge #6454bors[bot]-0/+65
6454: Fix overflow panic in convert_interger_literal assist r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-11-03Fix overflow panic in convert_interger_literal assistAleksey Kladov-0/+65
This also seizes the opportunity to move integer literal parsing to the syntax crate, were it logically belongs. Note though that this is still done in an ad hoc manner -- we probably should split kitchen sink ast::Literal into a separate APIs for strings, ints, etc
2020-11-02Make insert_use return a SyntaxRewriterLukas Wirth-0/+37
2020-11-02Deny unreachable-pubAleksey Kladov-3/+3
It's very useful when `pub` is equivalent to "this is crate's public API", let's enforce this! Ideally, we should enforce it for local `cargo test`, and only during CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
2020-10-23correct hover for items with doc attribute with raw stringsJosh Mcguigan-3/+11
2020-10-15Properly qualify trait methods in qualify_path assistLukas Wirth-0/+3
2020-10-08when generating new function, focus on return type instead of bodyBenjamin Coenen-1/+11
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-09-30Minor clippy performance suggestionskjeremy-1/+1
2020-09-29Merge #6019bors[bot]-5/+28
6019: Remove make::path_from_text r=matklad a=Veykril This removes the `make::path_from_text` function, which according to a note should've been private. I removed it since it didn't really serve a purpose as it was simply wrapping `make::ast_from_text`. Co-authored-by: Lukas Wirth <lukastw97@gmail.com>