Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fold custom region in CLion through comments?

I read this:

https://www.jetbrains.com/clion/help/folding-and-expanding-custom-blocks.html

and tried following this link:

https://www.jetbrains.com/clion/help/Folding_Custom_Regions_with_Line_Comments.html

but it appears to be broken, since it redirects to "Meet CLion" page.

How do I define custom folding regions in CLion using comments?

like image 794
becko Avatar asked Mar 14 '16 18:03

becko


People also ask

How do you collapse all in CLion?

To collapse or expand all code fragments, press Ctrl+Shift+NumPad - / Ctrl+Shift+NumPad + . CLion collapses or expands all fragments within the selection, or, if nothing is selected, all fragments in the current file, for example, all methods in a file.

How do you fold in IntelliJ?

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 + .

How do you open CLion source code?

Go to Header/Source To invoke Go to Header/Source, press F10 or call Navigate | Header/Source from the main menu.


1 Answers

CLion is based on IntelliJ IDEA, and thus supports multiple ways, including:

//region Description
//endregion

and

//<editor-fold desc="Description">
//</editor-fold>

These can be easily accessed by selecting the code you wish to wrap in a region, and hitting Ctrl+Alt+T. You can alternatively access it by clicking Code > Surround with... in the menu bar.

like image 172
Chloride Cull Avatar answered Sep 22 '22 23:09

Chloride Cull