krizzdewizz / vscode-refactorix

TypeScript refactoring tools for Visual Studio Code
Apache License 2.0
19 stars 6 forks source link

Create member class #1

Open AbraaoAlves opened 8 years ago

AbraaoAlves commented 8 years ago

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{

  }
}
krizzdewizz commented 8 years ago

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 commented 8 years ago

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.