Skip to content

Code folding

This library support code folding, but only for read-only editors. All editors on this page are therefore read-only. Code folding for writable editors is significantly more complex and therefore not implemented.

By default, the readOnlyCodeFolding() extension won’t fold any ranges. You need to pass folding range providers to the extension when it’s created.

There are currently 4 providers you can import:

You can easily create your own FoldingRangeProvier. The providers are called with the current editor and should return an array of foldable ranges. These ranges should span multiple lines.