vscode-refactorix
vscode-refactorix copied to clipboard
Create member class
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{
}
}
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.
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.