rust-analyzer
rust-analyzer copied to clipboard
Assist to derive `type alias = signature` for a function
Given some function
unsafe fn foo(param: u32) -> String { ... }
with the cursor on foo we should offer an assist that generates a type alias for the function's signature
type FooFn = unsafe fn(u32) -> String;
@rustbot claim
with the cursor on
foowe should offer an assist that generates a type alias for the function's signaturetype FooFn = unsafe fn(u32) -> String;
Any reason in particular not to use named params? As in:
type FooFn = unsafe fn(param: u32) -> String;
We could offer both actually (forgot param names are legal in that position), so a grouped assist that has an assist each to generate either, with or without params.
(additionally once trait aliases are stable we could offer a third option to generate trait FooFn = Fn(u32) -> String; etc)