You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing new namespaces Cursive always add it to the end of the list.
I think would be interested if Cursive could make it sorted, forcing sorting all the times could be bad, but Cursive could detect if the requires are already sorted, and if they are, insert the new require in the correct place so it keeps sorted.
For Java there's the Optimize imports command. I would have liked it to be the same for Clojure. There is configuration for Optimize imports, and it can be set to automatically optimize imports. This enforces specific ordering (lexicographically, but you can add exceptions to the sorting for specific packages to create groups).
The more complex functionality isn't such a big deal, but being able to sort namespaces using a shortcut, or automatically on save, would be great. Right now I use Emacs to do this with a before-save-hook to automatically sort requires on saving.
@Sardtok This has actually been implemented as an extension to the Optimise Imports command in the latest EAP series. See the 1.12.2 EAP series announcements on the mailing list: https://groups.google.com/forum/#!forum/cursive.
I'm planning to implement what Wilker suggests here as an improvement to the current single-namespace add, however, which is why this issue isn't closed yet.
When importing new namespaces Cursive always add it to the end of the list.
I think would be interested if Cursive could make it sorted, forcing sorting all the times could be bad, but Cursive could detect if the requires are already sorted, and if they are, insert the new require in the correct place so it keeps sorted.
The algorithm could be something like:
This would greatly help to keep the requires clean.
The text was updated successfully, but these errors were encountered: