- This topic has 3 replies, 2 voices, and was last updated 6 years, 11 months ago by Brian Fernandes.
-
AuthorPosts
-
Fedor LosevParticipantIt will be very helpful if we’ll have Organize Imports CTRL+Shift+O similar to Java one with missing import suggestions. Now fixing multiple missing imports one by one is a tedious task.
Brian FernandesModeratorFedor,
I suppose you would use this action to remove unused imports as well? Are there any additional features you would find useful/important? (Sorting, grouping, etc.)
Fedor LosevParticipantOf course, remove unused imports would be extremely nice to have, but it is less critical than adding imports (opposed to adding import, cleaning up imports can be done manually once in a while and it doesn’t produce a lot of friction in ongoing development).
Note, with outstanding huge TS problems of implicit imports/exports and such complex rules, full support for auto remove imports may be not feasible (e.g. https://github.com/Microsoft/TypeScript/issues/9944). May be it should be controlled by a setting at least on a project level (there are no such issues if one disables d.ts for a module so primitive remove unused can be applied safely, one may want it ON in some projects but not in others).
If Webclipse can also support an additional mode of adding required imports and removing unused imports taking in account implicitly re-exported types and compiler settings, it would very helpful, but probably this is very complex to solve, given that even compiler team still can’t figure it out.
Controllable sorting and grouping of course would be nice to have too. Again, for me it sounds less critical as it does not introduce a lot of development friction, but for long term I think an IDE should have all of these.
I think with such complex rules, issues,
*
imports, JS imports it sounds really complex and long term task to implement full grade organize with removal and expansion.Personally, I will be happy with something even simple but now, just something that automates going to missing import and fixing. Now there is even no common quick fix for this, one has to do one by one. CTRL+O for now may just apply all missing import quick fixes for file.
Brian FernandesModeratorFedor,
As always, thank you for your detailed notes and thoughts – yes, adding the missing imports would clearly be the most useful feature that will be implemented first.
-
AuthorPosts