-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Organise Imports should introduce 'named' import #22925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Moved upstream for more feedback. Again, we could consider adding this as an option but I would not want it enabled it by default. It may be a better fit for a refactoring actually |
@jrieken what is the intended meaning of the illegal syntax It's also not clear this always improves your file. For example, if you had some code somewhere: return { ShellExecutionDTO, TaskDTO, TaskHandleDTO }; we'd have to un-shortcut the object literal: return { ShellExecutionDTO: tasks.ShellExecutionDTO, TaskDTO: tasks.TasksDTO, TaskHandleDTO: tasks.TaskHandleDTO }; I'd very much be on board with an explicit command to un-destructure the import, but I can't imagine doing it automatically wouldn't raise some complaints. |
Maybe a " |
Well, it's a placeholder because TypeScript is unlikely to pick a name I like. It's similar to extract variable which is always followed by a rename.
Understood, but a corner case if you ask me. |
Closing this due to lack for much user feedback over the past two years. As noted, TS already has refactorings to convert between the two styles of imports. Changing styles automatically sounds more like something a linter should handle |
From @jrieken on March 27, 2018 12:43
re #46589
Organize import should rewrite imports with lots destructuring to the named variant, e.g
should become
Copied from original issue: microsoft/vscode#46682
The text was updated successfully, but these errors were encountered: