zokugun / vscode-explicit-folding

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

Question: Is it possible to replicate Visual Studio folding behaviour? #116

Open Sensuikan-U511 opened 1 month ago

Sensuikan-U511 commented 1 month ago

Considering the line above a free-standing opening bracket as the parent for folding. Like so:

2024-06-04 13_02_45 2024-06-04 13_02_51

Whereas the experience in VSCode is considerably worse:
2024-06-04 13_19_33 2024-06-04 13_19_36

Aside from folding at the wrong point, leaving twice as much vertical space consumed (which is the main thing I'm concerned with), VSCode also does a worse job of hiding the bracket; Visual Studio greys out the entire hidden {...};, while VSCode shows a white { with a greyed out ... which stands out strangely.

I'm aware that I can put the bracket on the same line as its parent, but changing my entire style of coding is painful. It's hard to go back to Visual Studio after having gotten VSCode almost perfectly configured to my tastes, so it would be wonderful if there were a solution to my folding woes, as it's the only sore point I have.

daiyam commented 1 month ago

Hi, the current extension only provides a list of folding range to VSCode. So it would need a new extension which would change how the foldings are displayed. But sadly, one of the issue is that an extension doesn't have access to a language properties (so no way to know how to recreate the foldings).