Everlaw / nbts

NetBeans TypeScript editor plugin
283 stars 46 forks source link

Please add functionality to fix unused imports #90

Open Chris2011 opened 7 years ago

Chris2011 commented 7 years ago

In Java there is an action where you can add a shortcut to it, to fix imports. It will remove unused imports and add missing imports (Missing imports will be handled here: #49). So It would be handy to have an action to fix imports but not only for adding imports for module which are missing, it should remove unused imports too. So this will be a linked ticket maybe to the #49 one.

Regards

Chris

jeffrey-easyesi commented 7 years ago

As of v2.3.2, if you put "noUnusedLocals": true under the compilerOptions in tsconfig.json, unused imports will have a codefix to remove them.

Chris2011 commented 7 years ago

Works, when I set the cursor to the module which is unused. But when I have 4 or more unused imports I have to do it one by one and this is unhandy. I want the same behaviour as Java does it in NetBeans where you have a refactor option + shortcut, where you can fix the imports for all. (Remove unused imports, add all missing imports with a dialog to add the right ones).

Regards

Chris