See https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_tools/src/boilerplate_gen.rs