首页 > 系统服务 > 详细

Eclipse Ctrl + Shift + O in IntelliJ IDEA

时间:2017-10-16 22:50:56      阅读:617      评论:0      收藏:0      [点我收藏+]

In Eclipse, you press CTRL + SHIFT + O “Organize Imports” to import packages automatically. For IntelliJ IDEA, if you press CTRL + ALT + O “Optimize Imports”, it just removes some unused imports, never imports any package. And the worst is you need click on the class name and press ALT + ENTER keys to import the package one by one.

Solution

The IDEA is working a bit differently, the “unambiguous imports” are imported on the fly, and you need to enable this feature manually.

File –>> Settings –>> Editor –>> General –>> Auto Import –>> Checked these options :

  1. Add unambiguous imports on the fly
  2. Optimize imports on the fly
技术分享
 
Note
For ambiguous imports (same class name in a different package), you still need click on the class name and press ALT + ENTER keys to import the package manually.

Eclipse Ctrl + Shift + O in IntelliJ IDEA

原文:http://www.cnblogs.com/zheting/p/7679164.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!