hocus-pocus icon indicating copy to clipboard operation
hocus-pocus copied to clipboard

Add types to the 'create class' quick fix

Open nickebbitt opened this issue 4 years ago • 0 comments

Is this request related to a problem? Please describe.

The create class quick-fix does not currently infer types. Introduction of the type checker in #3 should allow us to enhance (or provide an alternative quick-fix) that provides typing.

Describe the solution you'd like

Given the code:

new MyClass('some string', 1234)

the quick-fix would generate a class with types for the constructor args:

class MyClass {
  constructor(param1: string, param2: number) {
    // Implement
  }
}

nickebbitt avatar Jun 12 '20 21:06 nickebbitt