Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface stubbing for anonymous implementations #29363

Closed
tvald opened this issue Jun 23, 2017 · 1 comment
Closed

interface stubbing for anonymous implementations #29363

tvald opened this issue Jun 23, 2017 · 1 comment
Assignees

Comments

@tvald
Copy link
Contributor

tvald commented Jun 23, 2017

Similar to #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')
  },
}
@tvald tvald changed the title interface implementation stubbing for anonymous objects interface stubbing for anonymous implementations Jun 23, 2017
@mjbvz
Copy link
Contributor

mjbvz commented Jun 27, 2017

This issue was moved to microsoft/TypeScript#16755

@mjbvz mjbvz closed this as completed Jun 27, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants