intellij-solidity / intellij-solidity

Solidity plugin for IntelliJ

Home Page:https://plugins.jetbrains.com/plugin/9475-intellij-solidity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support of custom folding regions in sol-files

dvpublic opened this issue · comments

It would be nice to have possibility to split sol files on regions in same way as it's implemented in Webstorm for other languages, see https://www.jetbrains.com/help/idea/code-folding-settings.html

For example, if we have following code

//region Constants
   uint constant public v = 1;
//endregion Constants

//region Variables
   uint public a;
//endregion Variables

//region Initialization
  function init() external {}
//endregion Initialization

we should be able to collapse any regions, i.e.:

Constants                   // collapsed

//region Variables     // expanded
   uint public a;
//endregion Variables

Initialization              // collapsed

I'd like to have this feature too.
I usually add # to regional comments (in other languages) to make it work in VS Code as well.

//#region My Block
   some code
//#endregion