vscode-refactorix icon indicating copy to clipboard operation
vscode-refactorix copied to clipboard

Create member class

Open AbraaoAlves opened this issue 8 years ago • 2 comments

Like Webstorm and VisualStudio, write dreamcode before it there!

[ ] Fields [ ] Methods

Exemple:

Before:

class Foo {
  constructor(){
    this.bar = "test";

    this.init();
  }
}

After:

class Foo {
  bar:string;
  constructor(){
    this.bar = "test";
  }
  init(): void{

  }
}

AbraaoAlves avatar May 28 '16 01:05 AbraaoAlves

Hi, thanks a lot for your suggestions! This is very desirable to have. It would introduce a kind of "Quick Fix" feature. Technically, it seems best to try to analyze tsc error messages, such as Property 'bar' does not exist on type 'Foo', and suggest fixes based on those messages. I will look into that.

krizzdewizz avatar May 30 '16 23:05 krizzdewizz

TypeScript has plans for quick fix support in 2.1. https://github.com/Microsoft/TypeScript/issues/6943 and will most certainly be included in VS Code. Let's await and decide later.

krizzdewizz avatar Jun 07 '16 17:06 krizzdewizz