L&D series: Intellij IDEA things to help you code easier

Ferawati Hartanti Pratiwi
3 min readDec 18, 2020
https://pbs.twimg.com/profile_images/1206618215767584769/zl48EuhC.jpg

Learning and Development chapter 13.

This tutorial can be used on a macOS.

Unused Import

Why we need to import package that we won’t use?

We must checked the PreferenceEditorInspectionsUnused import first before continue to click PreferenceEditorGeneralAuto Import. Then check the Optimize imports on the fly for Java (I’m using Java here) or Kotlin. It will remove unused import automatically. If it doesn’t work, please re-open the file.

Space

To tidy up spaces, click the file itself or place the cursor in the file then press Command + Alt + L.

Not only we can adjust the space between the code, we can also adjust it like trailing spaces, trailing blank lines at the end of file and also a line break.

Long Line

Set the long line here.

Unused Class/Methods/Fields/Parameters

Click InspectionsJavaDeclaration redundancyUnused declaration. Then we must run it manually.

The result will be like this.

Quick Peek Method

Put the cursor in MperMperPisang(); then press Alt + Space.

Code Completion

Just press a space, dot or other keys will complete what we type with ease.

--

--

Ferawati Hartanti Pratiwi

QA (Quality Ambassador) | mpermperpisang official Medium account