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
Is there an option to fix all imports in single action similar to netbeans?
Quick fix supports this one line at a time. However would be nice if all imports got fixed in single go. When we copy code from other places resolving the imports one line at a time is time consuming.
@fbricon
Organize import will only organize imports if you have them. If i copy code and i want the imports to be added automatically in netbeans I run cntr+shift+I which brings up a prompt to import all the classes. screenshot mentioned above. So i dont have to type those imports by hand or one line at a time. I was referring to that feature.
Organize imports works just fine. This feature request is not the same.
@fbricon
Ok gave that a try, it works. all unambigous imports are added.
I was earlier doing organize imports via the quick fix helper so wasnt seeing quick fix when there were no imports. Once i did Alt+Shift+O or right click and Organize Imports it adds those import statements automatically. Thanks.
just out of curiosity, is it possible to perform the "Organise Imports" action on multiple files?
I've been tasked with refactoring a ton of projects from Ant to Maven, so I have a rather large number of import x statements to update at the moment.. so I'm wondering of this action could help me here?
I don't think it's enabled at the moment but we designed the server to support it. We just need to ensure the action is available from the explorer. Please open a separate issue
Activity
fbricon commentedon Apr 4, 2018
There's an "Organize imports" command (Alt+Shift+o)
fbricon commentedon Apr 4, 2018
Closing as duplicate of #56.
You can also organize imports as a save action.
gitorko commentedon Apr 6, 2018
@fbricon
Organize import will only organize imports if you have them. If i copy code and i want the imports to be added automatically in netbeans I run cntr+shift+I which brings up a prompt to import all the classes. screenshot mentioned above. So i dont have to type those imports by hand or one line at a time. I was referring to that feature.
Organize imports works just fine. This feature request is not the same.
fbricon commentedon Apr 6, 2018
no, "Organize Imports" will add missing imports as long as there are matching types on the classpath AND they're unambiguous.
eg.
At the moment, there's no UI to handle ambiguous imports, but the rest is all there
gitorko commentedon Apr 6, 2018
@fbricon
Ok gave that a try, it works. all unambigous imports are added.
I was earlier doing organize imports via the quick fix helper so wasnt seeing quick fix when there were no imports. Once i did Alt+Shift+O or right click and Organize Imports it adds those import statements automatically. Thanks.
ZaLiTHkA commentedon Jun 28, 2018
just out of curiosity, is it possible to perform the "Organise Imports" action on multiple files?
I've been tasked with refactoring a ton of projects from Ant to Maven, so I have a rather large number of
import xstatements to update at the moment.. so I'm wondering of this action could help me here?fbricon commentedon Jun 28, 2018
I don't think it's enabled at the moment but we designed the server to support it. We just need to ensure the action is available from the explorer. Please open a separate issue
ZaLiTHkA commentedon Jun 28, 2018
awesome, will do, thanks for the info. :)