I have this commented out piece of code in intellij:
As you can see, there is no possibility to fold comments here. However, the same commented block in Webstorm can be collapse:
Is there any way to configure comments collapsing in intellij/Android Studio?
To fold or unfold a code fragment, press Ctrl+NumPad - / Ctrl+NumPad + . IntelliJ IDEA folds or unfolds the current code fragment, for example, a single method. To collapse or expand all code fragments, press Ctrl+Shift+NumPad - / Ctrl+Shift+NumPad + .
Code or text folding, or less commonly holophrasting, is a feature of some graphical user interfaces that allows the user to selectively hide ("fold") or display ("unfold") parts of a document. This allows the user to manage large amounts of text while viewing only those subsections that are currently of interest.
Simply click the arrow to hide the comments.
To fold an arbitrary selected block
Source: https://www.jetbrains.com/idea/help/folding-and-expanding-custom-blocks.html
EDIT: It is a know bug, which can be found in JetBrains Bug Tracking System - IDEA-106702. It only affects block comments (/* comment */), all other comments are treated correctly.
General Editor folding settings
You can configure code folding in Settings (CTRL+ALT+S) - Editor → General → Code Folding
Here you can toggle folding outline and also configure default folding behavior for various file sections such as comments, imports, xml tags and more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With