-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Plugin isn't organizing Java Imports (Google Java Code Formatter/Code Style Google) #215
Comments
I'll have a(nother) look into this, but I'm not sure if I can add this functionality in the formatter as NetBeans separates formatting from organizing the imports. I'm just handling format requests, but reorganizing the imports is a completely different thing in NetBeans. But as said, I'll have a look and check what I can do, maybe there is a way of triggering the organize import action from the formatter or something like this. |
Great! :) I understand that it is 2 things now. So is it the case for all the formatters, Google but Eclipse and etc as well? If I have time, I'll take a look also. I have already a fork of your plugin. |
Yes, none of the formatters is organizing the imports right now and as said for NetBeans those are two different things and it also makes sense as the are no imports when formatting e.g. HTML. |
I found actions to sort the imports inside some of the formatters and try to add that functionality. Actually, I already did implement that, but - as formatting and sorting the imports are two different things (at least for the NetBeans Editor) - I found no way to skip the On-Save-Sort-Imports-Action from NetBeans so far, I'll try to find a solution for that and if it is not possible, I'll show a warning to manually disable it if the import sorting is activated for an external formatter. |
@jonathanpoulin9 |
Bug
When
Format
is called on the code editor, the plugin isn't organizing the Java Imports statements when it's using theGoogle Java Code Formatter
with the Code StyleGoogle
.That's important in order to comply with the Google Java Style, for the 3.3 Import statements definition.
Workaround
Right now the NetBeans' Organize Imports functionality can be use for that, but must be configured according to the rules found in the link above.
Note
Additionally, perhaps an plugin option can be made available to determine if we want to organize Imports or not when reformatting files. It can be useful in some situations.
The text was updated successfully, but these errors were encountered: