EndermanAPM
EndermanAPM

Reputation: 347

Enable Java Code Blocks folds in IntelliJ

If I recall correctly it was possible to fold codeblocks (IFs, FORs, etc) in IntelliJ-Java but now I'm currently only able to fold entire functions.

enter image description here

Oddly enough I can fold codeblocks in js files. enter image description here (moment.js fragment)

Is possible to install a plugin or enable a config to add the codeblock level folding in Java?

I'm aware that I could use custom folding regions but that's not what I'm looking for.

Upvotes: 2

Views: 461

Answers (1)

gromi08
gromi08

Reputation: 515

This is for IntelliJ 2017.2:

  1. Go to File -> Settings -> Editor -> General -> Code Folding and enable "Custom folding regions"
  2. Select the code to be folded
  3. Go to Code -> Folding -> Fold Selection

Upvotes: 1

Related Questions