interface stubbing for anonymous implementations #16755
Closed
Description
opened on Jun 27, 2017
From @tvald on June 23, 2017 22:31
Similar to microsoft/vscode#7073, provide a code action to create stubs for an anonymous implementation of a type:
interface Foo {
field: string,
func(): void
}
const bar: Foo = {}
// expand above line into...
const bar: Foo = {
field: 'string',
func(): void {
throw new Error('not yet implemented')
},
}
Ideally, this would also be able to stub in the anonymous implementation of a function argument, but that would require inference of the interface being targeted for implementation:
function example(arg: Foo): void { }
example({})
// expand above line into...
example({
field: string,
func(): void {
throw new Error('not yet implemented')
},
}
Copied from original issue: microsoft/vscode#29363
Activity