要根据 Settings/Preferences 对话框(&shortcut:ShowSettings;)的 Editor | code style 页上定义的样式重新格式化代码,请从主菜单中选择 code | reformat code。
你也可以使用 Code | Optimize Imports 来自动优化导入(移除未使用的导入等)。你可以在 settings/Preferences 对话框的 Editor | General | Auto Import 页上访问相应的设置(&shortcut:ShowSettings;)。