typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
109 stars 51 forks source link

Add "Organize Imports" command #669

Open camerondubas opened 8 months ago

camerondubas commented 8 months ago

As requested here https://github.com/typed-ember/glint/pull/635#issuecomment-1827566067, this adds a Glint: Organize Imports command. This is a destructive version of the "Sort Imports" command as it removes unused imports while also sorting.

These commands are analogous to the TS LSP's Sort/Organize commands.

This was just a matter of passing skipDestructiveCodeActions: false to the organizeImports language service method. As such, I've standardized on using organizeImports instead sortImports in the vscode extension.