rust-analyzer/crates/syntax/src/ast
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
..
generated Generate AnyHasDocComments node 2022-01-07 12:38:18 +01:00
edit.rs Use mutable syntax trees in merge_imports, split_imports 2021-11-19 20:02:27 +05:00
edit_in_place.rs Use mutable syntax trees in merge_imports, split_imports 2021-11-19 20:02:27 +05:00
expr_ext.rs Remove neesless clone 2021-10-10 10:50:51 +09:00
generated.rs Deny unreachable-pub 2020-11-02 14:07:08 +01:00
make.rs feat(diagnostics): use default expression instead of todo! when missing fields 2022-01-07 14:13:34 +01:00
node_ext.rs Better interface for doc comment and attribute processing 2022-01-07 14:14:33 +01:00
operators.rs internal: merge hir::BinaryOp and ast::BinOp 2021-08-14 18:10:01 +03:00
token_ext.rs Better interface for doc comment and attribute processing 2022-01-07 14:14:33 +01:00
traits.rs Better interface for doc comment and attribute processing 2022-01-07 14:14:33 +01:00