-
Notifications
You must be signed in to change notification settings - Fork 31k
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] configure initial collapse state #40338
Comments
Configuring additional folding markers in the settings is #36002. |
Sorry, but comment-folding wont help me - mostly all docs will be generated from source, more and more; why not completely hide them? I do not want to see any comment in my code when coding. It is never needed! It's only needed after a long break or mostly for others. So, why should we look every day, hour and minute on them? It cannot be a problem to hide them, if folding is already available in an IDE/Editor :| But - can i actually fold them to only a single char, like And whats about // line
// line
// line
...
# line
# line
...
/*
...
...
*/ as they are in several documents? Copy & Paste would might break all rules every time i do that (without saying Copy & Paste is accurate - but have a look at all ressources for coders). Nobody would write this by self every day when learning a new framework or software. |
Yes! Regions should be folded by default when you open the editor (assuming that it's impossible to remember the last state of that region between session). They are kind of useless right now to me because I use regions to hide complexity but every time I open a file in c# the regions are all unfolded so it's actually a pointless feature for what I think it was intended to be. |
Would love to have import blocks automatically folded in files with a simple user setting. |
Like in WebStorm. |
Is there anything we can do to help get this out? |
just add the attribute to "#region" e.g. |
So all your regions will be named Normally, we put a name after |
I mean, the Syntax in this case is secondary, for example, camelCase can be used. //#region Some name or description
// - ,-
//#regionEnd //#regionCollapsed Some name or description
// - ,-
//#regionEnd The current syntax |
I don't agree. It makes sense only for very custom regions. As I mentioned in #84844 I would like to default collapse all inline SVGs. And it's crazy to refactor whole project to add such |
I also do not agree; the use case for auto-collapsed imports is pretty important to many, and wrapping them in an explicit |
Initially, I came here in the search for settings as
by default. All I could find was "felicio.vscode-fold" from the marketplace. In a previous post, I want to say that instead of inventing a new tool and new XML like syntax, it is possible to use the existing "#region" functionality. This applies to the original "issue". |
Here's an example of the payload returned by the Java language server:
Everything's already in place in folding.ts to fold blocks based on kind:
Then you could expose new settings, so that we could set something like:
|
@fbricon Really awesome! Wish I had time to contribute such a setting. Thanks for digging. Hopefully some kind person implements it for TS eventually =) |
This could only work based on So if you want to collapsed some long functions in the long run or private functions by default, you wouldn't be able to. |
Would love this! 🚀 |
any update on this one? for larger projects, it'd be great to offer the ability to collapse imports by default as many IDEs do |
@mjbvz said »Folding of imports is now in vscode with d8e5520«. TypeScript’s part on this is done, too. As i under stand it: The feature is already implemented. Only thing missing: A boolean in the vscode config to enable it. |
Automatic folding of imports has been added through #128809. |
YESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS! Will this be part of the release notes for the next version of VSCode? |
You can try vscode insiders which has nightly build. |
@aeschli I tried latest insiders build (1.59.0-insider Commit: b805d2e, Date: 2021-07-20T05:12:13.059Z), But Java imports are still not folded by default, despite:
|
Yes, you need Version: 1.59.0-insider and you need to set I tried it with Java and got it working. But yes, it's not yet tested well. For now, it will be off by default. Please file separate issues. |
Thanks @aeschli , |
This works. Thanks! |
Nice to see the auto-folding of the imports when opening a file as a setting. Thanks much. Still would love to see a setting for auto-folding of regions when opening a file. |
#84844 (Automatic folding/collapsing of specified HTML tags (ie. <svg>) on file load) got closed as a duplicate of this one, and I don't see that particular use-case being discussed much here. Please don't forget about that one. Either reopen that issue or make sure it's addressed here. I.e. How is this issue going to allow for specific XML/HTML/SVG elements to be collapsed by default without manual insertion of region folding markers? Related on Stack Overflow: Is there a way to automatically fold specific XML/HTML/SVG tags in VS Code? Related extension: https://github.com/moalamri/vscode-inline-fold#svg |
+1 to being able to fold regions. My use-case is for an HTML file that has to be a single file. <!-- #region(collapsed) Image -->
<img
id="logo"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAA
...
...
... many... many lines.
...
...
" />
<!-- #endregion --> If only |
What about only folding first comment block, like long legal disclaimer? Test cases from Eclipse:
also in python and other languages. Comment is auto detected as foldable, it just needs a trigger to fold the first, as I know VScode stores the fold state for each file, so it would only be one extra line of code to fold the first entry of that. |
Being able to collapse SVG tags in HTML on load would be a time saver! |
I too wish there should be ability to fold the binary encoded block with some custom marker in the file. Such as |
Maybe I missed something ... I recently migrated my javascript project from netbeans to visual studio code ... in netbeans we use
for defining regions ... I saw I could modify javascript-language-configuration.json to
SO my request includes 2 questions :
The text was updated successfully, but these errors were encountered: