유틸 및 각종 자료/이클립스

intellij에서의 auto import

RBWSN 2016. 8. 27. 22:31
728x90

Excluding Classes from Auto-Import

On this page:

Introduction

The list of imports suggested by IntelliJ IDEA can be sometimes far too wide, and can include the classes you don't actually need. For example, some of the class names in your project can match the names of internal SDK or unrelated library classes.

IntelliJ IDEA lets you configure the classes to be excluded from import assistance and code completion, thus helping avoid unintentional use of the wrong classes. Besides that, IntelliJ IDEA provides an intention action that allows you to exclude unnecessary classes on-the-fly.

These settings apply to code completion as well. The classes and packages specified as the ones to be ignored by the code completion feature, will not be added to the suggestion list.

Configuring imports

To configure classes to be excluded from import

  1. Open the Settings/Preferences dialog box, and under the Editor / General node, click Auto-Import.
  2. On the Auto-Import page, click add (Alt+Insert).
  3. In the dialog box that opens, type the name of the class or a whole package to be excluded, and click OK.

    Use add (Alt+Insert) and delete (Alt+Delete) to manage the list of classes and packages that IntelliJ IDEA shouldn't place to the suggestion list.

  4. Apply changes and close Settings/Preferences dialog.

Excluding classes from imports

To exclude classes from imports in the fly

  1. Start typing a name in the editor, and use intention action as described in the section Creating Imports:
    import
  2. In the Class to Importsuggestion list, select the class you want to be ignored, and click the right arrow to reveal the nested list of intention actions. IntelliJ IDEA suggests you to exclude specific class or the whole containing package:
    import3.png
  3. Click the desired class or package to be excluded.





1. 먼저 Ctrl + Alt + S 로 설정창을 연뒤 Editor -> General -> Auto Import를 클릭한다

2. 그리고 Auto Import 페이지에서 클릭 후 Alt + Insert를 누른다.

3. 다이얼 박스가 오픈된뒤 클래의 타입을 지정하거나 패키지를 excluding 하고 Ok를 루른다.

더 많은 것을 임포트 하고싶다면 Alt + Insert로 지정 하거나 삭제하고 싶다면 Alt + Delete로 리스트에서 클래스와 패키지를 추가 삭제 할수있다.

4. 변경된 사항을 적용하고 닫는다.


To exclude classes from imports in the fly

1. 에디터에 이름을 타이밍 한뒤 액션 설명저를 섹션에 작성 가능하다.

2. 클래스의 리스트는 무시하고자하는 클래스를 선택한뒤, 목록을 나타내기 위해 오른쪽 화살표를 클릭한다. 

목록은 너가 exclude한 클래스 또는 포함된 패키지를 제외 하는것을 의미한다.


728x90