You can use the google style method, or the unified code Style/file and code template file of the respective company
1. Install google-java-format
preferences -> plugins -> Browse repositories...
search for google-java-format
Enable google-java-format
2. Install save actions
preferences -> plugins -> Browse repositories…
Search for save actions to
enable
automatic formatting when save actions are saved, and
delete useless import statements
Three, automatically optimize the guide package options
Optimize imports on the fly: automatically remove some unused packages
Add unambiguous imports on the fly: automatically help us optimize imported packages unambiguous: explicitly
Fourth, check the line separator/indent size
Line separators need to be unified, and windows must not be used
The indentation size needs to be uniform