Better Folding provides many commonly requested folding-related features all together in one extension.
This is the first release of the extension, so it is not fully battle tested yet. If you encounter any issue or would like to contribute, please visit the GitHub page.
Based on microsoft/vscode#76396
Based on microsoft/vscode#168028
Most brackets-based languages: JavaScript, TypeScript, C, C#, C++, Java, Kotlin, PHP, Go (Golang), Dart, Rust, Swift, CSS, LESS, SCSS and more...
XML-based languages: JSX and TSX.
Work in progress: HTML.
For example:
This extension contributes the following settings:
betterFolding.foldClosingBrackets
: Include closing brackets like}
and]
in the folding range. extension.betterFolding.showFoldedBodyLinesCount
: Shows the number of lines folded, excluding the closing bracket line.
Example:function example() { ⋯ 3 lines ⋯
.betterFolding.showFoldedBrackets
: Shows brackets like{
and}
in the collapsed text.
Example:function example() {…}
.betterFolding.showOnlyRegionsDescriptions
: Only shows the region description in the collapsed text.
Example://#region some text ⋯
.
Becomes:some text
.betterFolding.excludedLanguages
: List of languages to exclude from folding.
- When switching between tabs, the folding ranges take a second to update. This is an issue with VS Code itself. Waiting for a fix.
- If a folding range is at the end of the file, sometimes it would fold the start line while scrolling. Again, this is an issue with VS Code API, will submit an issue to their repo soon.
- The cursor can hide behind the folded text. Working on a fix.
See the project's changelog here.
Bracket-Pair-Colorizer-2 (by CoenraadS)
vscode-blockman (by leodevbro)
vscode-inline-fold (by moalamri)
vscode-explicit-folding (by zokugun)