rust-analyzer
rust-analyzer copied to clipboard
Add auto trait name for generate_trait_from_impl
Auto generate trait name from first method.
Input:
impl S$0 {
fn foo() {}
}
Old output:
trait NewTrait {
fn foo();
}
impl NewTrait for S {
fn foo() {}
}
This PR output:
trait Foo {
fn foo();
}
impl Foo for S {
fn foo() {}
}
Why specifically from the first method, or from methods at all? I'm not sure this is advantageous.
Having placeholder snippet group, incorrect name is irrelevant