zokugun / vscode-explicit-folding

Customize your Folding for Visual Studio Code
MIT License
99 stars 14 forks source link

request: support for a ' middle' folding option #13

Closed just-Addict closed 4 years ago

just-Addict commented 4 years ago

I was wondering if it was possible to add support for a ' middle' option What I mean is this I am working on a HLSL shader file which contains a fair bit of conditional defines. The code contains branching constructions in the form of `

ifdef/#if defined / #ifndef

elif

elif

endif

where the number of branches can vary from 1 up to as many as needed. At the moment the extension folds everything between#ifdef/#if defined / #ifndefand the closing#endif` as a single block.

What I would like to do is be able to fold each branch separately instead of the whole #if... - #endif block.

I wouldn't mind trying to implement this myself but I know nothing about the internals of VCode and don't even know if VCode itself supports such a mechanism.

daiyam commented 4 years ago

It might be possible. I just need to find some time...

just-Addict commented 4 years ago

ideally it would be great if it could work like documented here for Notepad++

https://ivan-radic.github.io/udl-documentation/folding-in-code/ https://ivan-radic.github.io/udl-documentation/folding-in-comment/

daiyam commented 4 years ago

Hi @just-Addict , I've implemented your needed option in 7ed6d0cc4e4d83b9a8a2a5b9ef43a9101a77bd29 (v0.4.0).