zokugun / vscode-explicit-folding

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

Indentation folding. #7

Closed Lovecircle closed 4 years ago

Lovecircle commented 5 years ago

Is there a way to use indentation folding strategy of the VSC together with custom folding strategy of the extension:

https://youtu.be/gQXz_G-bd2U

daiyam commented 5 years ago

Hi Alexej,

You shouldn't have that issue with the indentation folding.

Here a screenshot of my test: screenshot

Can you check if you have any error in the outputs or in the Developer Tool console?

I could integrate the indentation folding provider in my extension but it will only partially fix your problem. (In your example, the th should also be foldable.)

Lovecircle commented 5 years ago

The thing is that in my other files everything works fine just like on your screenshot, it's just in this one file something goes wrong. I tried to remove parts of the file to find what causes the problem but still wasn't able to pinpoint what causes it. There's nothing in the debug console and the code works without a hitch. I filed a bug report but in the meantime it would be amazing if you would add the indentation feature. Concerning "th" or some other html tag not folding - this doesn't bother me as long as I can wrap some big chunk of code in #region and fold it.

daiyam commented 5 years ago

If it's a very long file, there is a hard limit of 5000 foldings. If I read the code correctly, it includes the foldings with the less indentation. It could explain your issue. If it's the case, you could use some include_once or include to split the file. If not, can you send me the file for testing?

Lovecircle commented 5 years ago

You are right - it's the limit. I simply copy-pasted the same function and at some point folding just stopped working. My file is about 30 000 lines - not that big actually, and I included what I could using "require_once" but all that other stuff has to be in one file because it has interconnected functions all over it and if I use "require" then functions inside the "required" file are not hoisted and I get errors because functions are called but not yet defined. I'll file a feature request to be able to up that hard limit of number of foldings in one file. I attached the file - line 43914 is where folding stopped working.

test_ident.zip