Skip to content
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

Enable code folding and collapsing #105

Closed
egucciar opened this issue Nov 18, 2015 · 30 comments
Closed

Enable code folding and collapsing #105

egucciar opened this issue Nov 18, 2015 · 30 comments
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@egucciar
Copy link

I searched but couldnt find this in the issues. Id love to be able to collapse sections of the code. Any thoughts?

@chrisdias chrisdias added the feature-request Request for new features or functionality label Nov 21, 2015
@Sevin777
Copy link

Now that is being developed, I have a few suggestions:


Please add support for this code folding operation (I don't know what to call it):

  1. Fold all blocks
  2. Unfold the block that the cursor is currently in (where it was located before the fold all command)

In the ACE Editor this is called 'FoldOther' and it is bound to hotkey Alt+0 by default. Try it out here (put your cursor inside of a function block and press Alt+0; Shift+Alt+0 then unfolds all).

This folding operation is incredibly useful because it allows you to quickly collapse everything except for the block of code you're currently looking at - which lets you focus on a single block of code.


Please make all curly braces create a folding block in C-style languages
Example: In Visual Studio (not visual studio code) - curly braces only produce a folding widget for classes and members, which is why this plugin exists. The problem is the plugin has major performance issues in large files, which is something that can be avoided if the proper folding support is added natively. Note: This should be supported in ALL C-style languages including: C, C#, JavaScript, Java, etc...


Please include support for region folding in all C-style languages
Regions are officially part of C#, but not other C-style languages. However, they are useful in other C-Style languages.

The ACE Editor already has support for this type of folding.

This feature should have an option to turn it off, because for every person that loves regions, there is another person who hates them.

Also, it would be great to have this for SQL-Server (Microsoft's SQL) mode (once the language is added). I personally created a SQL Server mode for the Ace Editor and I included this feature. Try it here: Select 'SQLServer' for the document in the top left corner.


Please make JSDoc style comment blocks foldable in all C-style languages

/**
 * These comments should produce a fold widget (on the first line)
 */

Note: I see that each language file seems to have its own folding structure. It may be useful to have a way to inherit folding modes because so many modes should share the same C-style folding.

@flyfj
Copy link

flyfj commented Feb 2, 2016

I have trouble working with large files without code folding, may switch to other editors for a while until vs code gets this

@egamma egamma mentioned this issue Feb 2, 2016
97 tasks
@hdf
Copy link

hdf commented Feb 13, 2016

I would like notepad++ compatible code folding:

//{ This folds
code here
//}

@Nimzozo
Copy link

Nimzozo commented Feb 13, 2016

Important feature indeed.
With Netbeans, we can also add <editor-fold> tags to create a folding block.

@alexdima alexdima assigned aeschli and unassigned alexdima Feb 22, 2016
@eugeneniemand
Copy link

Hopefully this will work in all languages for curly braces including PowerShell and Javascript and not only C languages. Comment folding would be nice to.

@alexdima alexdima modified the milestones: Feb 2016, Backlog Feb 22, 2016
@joaomoreno
Copy link
Member

A first version of this feature will be on the February release.

@Nimzozo
Copy link

Nimzozo commented Feb 24, 2016

A first version of this feature will be on the February release.

👍

@hulang
Copy link

hulang commented Mar 7, 2016

Folding function must be in March 31st to have it?

@glen-84
Copy link

glen-84 commented Mar 7, 2016

@hulang See the release dates here #2616

@RANUX
Copy link

RANUX commented Mar 7, 2016

After update to latest version of VSCode (0.10.10) i found that folding doesn't work for recommended C# comment tags. ( https://msdn.microsoft.com/en-us/library/5ast78ax.aspx )

@Novack
Copy link

Novack commented Oct 28, 2016

#region folding seems missing.

@topgun743
Copy link

Don't understand why Visual Studio Code team not adding this #region #endregion feature still after so many builds of theirs. Its a must for their product.

@rhtpandeyIN
Copy link

Please add #region #endregion feature. Its a must for well management code.

@tealm
Copy link

tealm commented Feb 15, 2017

+1 for #region #endregion, needs to be added!

@CarlosRodrigues
Copy link

CarlosRodrigues commented Feb 24, 2017

And for typescript/javascript:
//#region
code here
//#endregion

would also be great!

@john-yick
Copy link

#region and #endregion would be amazing for JS

@ghost
Copy link

ghost commented Mar 25, 2017

+1 for #region and //#region.

@HecticHiccups
Copy link

yes!

@Eraph
Copy link

Eraph commented Mar 29, 2017

Another request for #region folding here.

@henioStraszny
Copy link

Same here, would love it for C#, TS and JS.

@cperezortiz
Copy link

would like it too 😄

@ChayaCooper
Copy link

+1 for PHP in both Visual Studio and WebMatrix

@kymowang
Copy link

kymowang commented May 8, 2017

even Intellij Idea supports //region folding

@Pulstura
Copy link

Pulstura commented May 8, 2017

Really wish region folding was implemented in VSCode!

@ghost
Copy link

ghost commented May 29, 2017

@pedrorolo Really 5px?

@pedrorolo
Copy link

when you use a small screen it becomes relevant. I have just disabled them by searching for folding in "preferences"

@ghost
Copy link

ghost commented May 29, 2017

@pedrorolo I see, glad you solved it.

@ColacX
Copy link

ColacX commented Jul 17, 2017

Hello i want this for CSS is this implemented yet? I see that the issue is closed. Thanks for making this great editor btw.

@aeschli
Copy link
Contributor

aeschli commented Jul 18, 2017

@ColacX The current folding only depends on indentation and is not language aware.
The request for language aware folding is #3422

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests