IT Information/IT Tips ๐Ÿฏ

[Intellij] ์•ˆ์“ฐ๋Š” import ์ œ๊ฑฐ ํ•˜๋Š” ๋ฐฉ๋ฒ• (๋‹จ์ถ•ํ‚ค/์ž๋™ ์„ค์ •)

yuri lee 2022. 11. 9. 08:19
๋ฐ˜์‘ํ˜•

Intro

์ธํ…”๋ฆฌ์ œ์ด์—์„œ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” import ๊ตฌ๋ฌธ์„ ์ œ๊ฑฐํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. 

 

How to do

1. Intelij > Code > Optimize Imports ์‚ฌ์šฉ (control + option + O)

์œ„ ๋ฐฉ๋ฒ•์€ ์ˆ˜๋™ ํ˜น์€ ๋‹จ์ถ•ํ‚ค๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. 

 

2. Preference > Editor > General > Auto Import > Optimize Imports on the fly ํด๋ฆญ 

์œ„ ๋ฐฉ๋ฒ•์€ ์ž๋™์œผ๋กœ ์„ค์ •ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. 

์ œ ๊ฒฝ์šฐ์—๋Š” Kotlin Editor๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด์„œ, Kotlin์˜ Optimize imports on the fly์— ์ฒดํฌ๋ฅผ ํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค. 

๋ฐ˜์‘ํ˜•