-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Source printer import ordering strategy #3807
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
Source printer import ordering strategy #3807
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3807 +/- ##
===============================================
+ Coverage 57.490% 57.574% +0.083%
Complexity 2182 2182
===============================================
Files 635 638 +3
Lines 33802 33878 +76
Branches 5837 5850 +13
===============================================
+ Hits 19433 19505 +72
- Misses 12290 12293 +3
- Partials 2079 2080 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
As usual it is a very nice contribution. |
Hi @jlerbsc. Thanks for your feedback! For example, in intellij the order is:
On eclipse the order is:
If you have any suggestion, please let me know! I would be happy to integrate it. |
No I have no idea that's why I asked you for yours. Have you finished this PR? |
Yes I have finished it :) |
Hello!
This PR adds support for custom import ordering.
Previously, the user could not define the "template" to be used for imports, only having the option to have imports like this:
What if the user wants to separate the static imports from the others? What if the user wants to group all java imports into a single group?
Example:
With this PR this can now be achieve Included in this PR, there are 3 implementation of import ordering.
An example of code that makes the printer use a custom formatitng can be seen below:
This design is flexible, so if the user wants to create their own implementation they can also do it.
Feedback is welcome! :)