about summary refs log tree commit diff
path: root/crates/syntax/src
AgeCommit message (Collapse)AuthorLines
2022-01-30Reduce allocations in attribute collectionLukas Wirth-17/+18
2022-01-22removed printsJeroen Vannevel-1/+1
2022-01-22hacky_block_expr_with_commentsJeroen Vannevel-8/+9
2022-01-22removing unwrapsJeroen Vannevel-4/+5
2022-01-22very rough but comments get extractedJeroen Vannevel-0/+23
2022-01-15Move format specifier lexing from syntax to ide_dbLukas Wirth-297/+20
2022-01-13Slightly cleanup HasFormatSpecifier::lex_format_specifierLukas Wirth-213/+146
2022-01-08Shrink diagnostic spans for errors inside macrosJonas Schievink-1/+0
2022-01-08Allow doc comments on all `Item`sJonas Schievink-5/+12
2022-01-08Merge #11107bors[bot]-2/+10
11107: Fix generic type substitution in impl trait with assoc type r=pnevyk a=pnevyk Fixes #11045 The path transform now detects if a type parameter that is being substituted has an associated type. In that case it is necessary (or safe in general case) to fully qualify the substitution with a trait which the associated type belongs to. This PR also fixes the previous wrong behavior of the substitution that could create an invalid tree `PATH_TYPE -> PATH_TYPE -> ...`. Co-authored-by: Petr Nevyhoštěný <petr.nevyhosteny@gmail.com>
2022-01-07Merge #11230bors[bot]-0/+1
11230: fix: Fix attribute stripping ignoring doc comments r=Veykril a=Veykril Follow up to https://github.com/rust-analyzer/rust-analyzer/pull/11225#pullrequestreview-846779237 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-07fix: Fix attribute stripping ignoring doc commentsLukas Wirth-0/+1
2022-01-07Merge #11145bors[bot]-0/+22
11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields before: ```rust pub enum Other { One, Two, } pub struct Test { text: String, num: usize, other: Other, } fn t_test() { let test = Test {<|>}; } ``` after: ```rust pub enum Other { One, Two, } pub struct Test { text: String, num: usize, other: Other, } fn t_test() { let test = Test { text: String::new(), num: 0, other: todo!(), }; } ``` Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
2022-01-07Better interface for doc comment and attribute processingLukas Wirth-10/+28
2022-01-07feat(diagnostics): use default expression instead of todo! when missing fieldsBenjamin Coenen-1/+1
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2022-01-07Generate `AnyHasDocComments` nodeLukas Wirth-19/+93
2022-01-06Use`const _` instead of `mod __`Jonas Schievink-6/+3
2022-01-06Expand attribute macros on impl and trait itemsJonas Schievink-0/+11
2022-01-04add better default behavior on fill struct fields diagnosticBenjamin Coenen-2/+21
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-12-30feat(diagnostics): use Default::default() expression instead of todo! when ↵Benjamin Coenen-0/+3
missing fields Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-12-29Migrate to SyntaxNodePtr in new rowanAriel Davis-44/+10
2021-12-28dead codeAleksey Kladov-5/+5
2021-12-28introduce hacks moduleAleksey Kladov-41/+16
2021-12-28dead codeAleksey Kladov-7/+0
2021-12-28remove fragments from syntaxAleksey Kladov-43/+0
2021-12-28drop dead codeAleksey Kladov-25/+0
2021-12-28remove Item::parseAleksey Kladov-16/+0
2021-12-28internal: start isolating ssr-related parsing APIs to SSRAleksey Kladov-16/+0
2021-12-26internal: move inline parser tests to parser crateAleksey Kladov-147/+3
2021-12-26internal: move outlined parser testsAleksey Kladov-7/+12
2021-12-26internal: move ws attachment logic to the parser crateAleksey Kladov-196/+33
This has to re-introduce the `sink` pattern, because doing this purely with iterators is awkward :( Maaaybe the event vector was a false start? But, anyway, I like the current factoring more -- it sort-of obvious that we do want to keep ws-attachment business in the parser, and that we also don't want that to depend on the particular tree structure. I think `shortcuts` module achieves that.
2021-12-25renameAleksey Kladov-44/+39
2021-12-25internal: renameAleksey Kladov-15/+15
2021-12-25internal: replace TreeSink with a data structureAleksey Kladov-43/+47
The general theme of this is to make parser a better independent library. The specific thing we do here is replacing callback based TreeSink with a data structure. That is, rather than calling user-provided tree construction methods, the parser now spits out a very bare-bones tree, effectively a log of a DFS traversal. This makes the parser usable without any *specifc* tree sink, and allows us to, eg, move tests into this crate. Now, it's also true that this is a distinction without a difference, as the old and the new interface are equivalent in expressiveness. Still, this new thing seems somewhat simpler. But yeah, I admit I don't have a suuper strong motivation here, just a hunch that this is better.
2021-12-23Fix generic type substitution in impl trait with assoc typePetr Nevyhoštěný-2/+10
2021-12-21Fully render type alias completions from hirLukas Wirth-15/+0
2021-12-21Fully render const item completions from hirLukas Wirth-21/+0
2021-12-18internal: move all the lexing to the parser crateAleksey Kladov-395/+61
2021-12-18minor: dead codeAleksey Kladov-13/+1
2021-12-14`match_ast!` takes a pattern to allow underscore usageLukas Wirth-2/+2
2021-12-13Merge #10998bors[bot]-26/+23
10998: Add number representation assists r=Veykril a=errx Reimplemented assists from this PR https://github.com/rust-analyzer/rust-analyzer/pull/3683 with current APIs. ![image](https://user-images.githubusercontent.com/462486/145726792-47700215-26f2-4fdc-9520-63d1487901e5.png) ![image](https://user-images.githubusercontent.com/462486/145726802-f528a2f7-9159-41d3-b459-fc3fae033e60.png) I've decided not to add options about size of the groups so behaviour is similar to clippy's. Minimal number length is also taken from clippy. Co-authored-by: Oleg Matrokhin <matrokhin@gmail.com>
2021-12-13Reuse results from split_into_parts()Oleg Matrokhin-15/+5
2021-12-13Add number representation assistsOleg Matrokhin-26/+33
2021-12-12tighten up invariantsAleksey Kladov-8/+12
2021-12-12more orthogonal interfaceAleksey Kladov-1/+2
2021-12-12parser tests workAleksey Kladov-103/+60
2021-11-24Remove possible multiline details in completionsLukas Wirth-22/+32
2021-11-19Use mutable syntax trees in `merge_imports`, `split_imports`iDawer-40/+74
2021-11-16Remove validation of `super` in use pathsLaurențiu Nicola-39/+0
2021-11-15Fix `impl_def_from_trait`TheDoctor314-64/+8
Revert "Fix `impl_trait` function to emit correct ast" This reverts commit 55a4813151a8f36dcdb520c45a461fe5dfbed499. Fix `impl_def_from_trait` It now generates the correct `ast::Impl` using `generate_trait_impl_text` and parses it to form the right node (copied from the private fn 'make::ast_from_text').