rust/crates/syntax/src
bors[bot] 40009e07d0
Merge #11145
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-07 14:10:11 +00:00
..
ast Merge #11145 2022-01-07 14:10:11 +00:00
parsing dead code 2021-12-28 19:13:30 +03:00
tests Generate AnyHasDocComments node 2022-01-07 12:38:18 +01:00
validation Add semicolons for consistency 2021-10-03 23:39:43 +11:00
algo.rs Make selections in assists with trailing/leading whitespace more forgiving 2021-10-12 14:41:59 +02:00
ast.rs Better interface for doc comment and attribute processing 2022-01-07 14:14:33 +01:00
display.rs Fully render type alias completions from hir 2021-12-21 16:36:23 +01:00
fuzz.rs Add more docs 2021-05-22 16:53:47 +03:00
hacks.rs dead code 2021-12-28 19:13:30 +03:00
lib.rs introduce hacks module 2021-12-28 18:57:13 +03:00
parsing.rs dead code 2021-12-28 19:13:30 +03:00
ptr.rs Migrate to SyntaxNodePtr in new rowan 2021-12-29 23:48:53 -08:00
syntax_error.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
syntax_node.rs internal: replace TreeSink with a data structure 2021-12-25 22:02:26 +03:00
ted.rs Add semicolons for consistency 2021-10-03 23:39:43 +11:00
tests.rs remove fragments from syntax 2021-12-28 17:00:55 +03:00
token_text.rs Imrove fn name computation in Generate function 2021-09-16 21:03:37 +05:00
utils.rs Better strip turbofishes 2021-03-08 23:59:39 +02:00
validation.rs match_ast! takes a pattern to allow underscore usage 2021-12-14 12:44:31 +01:00