The keyboard shortcut completely hides Java-doc comments, so they no longer take any lines in the code

I know the shortcuts:

CTRL + SHIFT + +

CTRL + SHIFT + -

Which extensions and minimization comments are Java-doc respectively. However, this way of folding the line retains the space bar:

enter image description here

How do you swear so that no lines of code are busy with comments? . As I can see, the java-dok comments above go beyond 1 line of code.

I am trying to work without distraction and thus only want to show my actual code.


Here is the official Intellij page where code folding shortcuts come down (Android Studio is the Intellij fork, so they are almost the same shortcuts). I can not find the shortcut I'm looking for here.

+7
java intellij-idea android-studio
source share
2 answers

Select the part you want to hide and press ctrl + alt + T. Choose either

 //<editor-fold desc="Description"> // part to hide //</editor-fold> 

or

 //region Description // part to hide //endregion 

Change Description to something that will not distract you, for example _ .
After collapsing this block, you will see only _ .

+2
source share

Code → Folding → Collapse document comments

+3
source share

All Articles