-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[folding] Collapse ending brace to the same line #3352
Comments
This would not work for languages which do not use punctuation to signify code blocks (i.e python) Code Folding at the moment uses indentation and so will close everything up to the next line on the same indentation level as the folding line. The implementation would have to change to fold the closing bracket as this would cause issues in some languages |
👍 |
ping @alexandrudima |
👍 |
👍 definitely, would help so much |
I like how Jetbrains does theirs which matches "bracket" I also love being able to fold not only from the first bracket but also the last bracket. They also have essentially peeking for brackets when they're not on screen so you can see what they belong to. I used to comment what ending brackets belonged to, then I stopped due to the IDE, now I'm feeling lost again w/o it. I also really like how notepad++ puts the trailing line as mentioned in Alternative Designs #2 |
I'm for the current model, but since people still think there is something to be corrected I think a preference is in order, something like |
Also would prefer a way to make it one-line. I often use the folding in CSS and liked the way the Jetbrains IDEs put the collapsed selectors on one line. |
Can you solve it? I have this same problem uncomfortable, I read the other post about it, but I did not see anything finished that can help me, someone there knows how to solve ?? it really is very uncomfortable working with multiple collapsed lines, because with this line more than "}" it is difficult and confusing to work. |
I like the 'Brackets' example, looks clean |
Hi people! I think would be nice to see vscode folding with info about amount of lines folded like Netbeans: BTW: Thank you for this awesome code editor! 😄 Related issue here: #29155 |
I would really like to see this implemented. But, in the meantime, is there an extension that does that? |
I would to see this implemented soon. It's a right pain. Visual Studio working perfectly for collapse and expanding structure. |
@angelozerr I think your issue is different from the original issue. You should open a new one. |
I would like to highlight a problem with the "Collapse ending brace to the same line" issue but if you think it's better to create a new issue, I can do that. |
Explicit Folding extension does the trick. But while I was reading this thread. As @aeschli mentioned:
I checked it in .js file for this piece of code (
And it turned out that it folds differently based on
For
For This could mean that, unlike in the past, now indentation-based stategy is not the only one VS Code has, and there is already some bracket-based or language-specific strategies under the hood, or indentation-based add-ons that weren't thought of as a possibility before. In any case, it looks like there is now room for the code that can solve the issue. |
not work at all for me |
Hey everyone, I managed to make an extension that solves this problem along with other many requested folding-related issues. You can find it here: https://marketplace.visualstudio.com/items?itemName=MohammadBaqer.better-folding A demo of the extension in action: Screen.Recording.2023-01-23.at.11.29.10.mov |
My Hero !! |
Cool stuff! But I have one problem, folding stops working in html |
HTML, JSX and TSX support coming soon. You can see the full list here |
This is great! Thanks a lot. I'm looking forward to it. |
Thanks man, I was waiting for it for a long time. |
Thanks for your hard work, the folding extension is fantastic! |
Mate, you are a bloody legend! |
@mtbaqer 's extension "Better Folding" works great! Until you restart vscode. Then it reverts to the default behavior. |
I know there are some alternatives (thanks to the plugin makers), but please, it's been more than 8 years since we ask for this ! I think VSCode is maybe the greatest code editor of all time (at least for the moment). Make it even mor legendary by adding this feature ! <3 |
Is this so difficult to add? |
For almost 10 years now, people have been asking to do normal code folding. I guess we should wait another 10 years before we start using vscode. lol. |
@ScottBeeson |
Consider a large JavaScript file
Collapsing all currently yields:
This would be more readable if the closing brace was on the same line:
Here is how other prominent editors handle the above:
Atom
Brackets
Sublime Text 3
VS Code
The text was updated successfully, but these errors were encountered: