Monaco-editor: [question] Is folding supported?

Created on 9 Sep 2016  路  7Comments  路  Source: microsoft/monaco-editor

In vscode i can define 'foldingStartMarker' and 'foldingStopMarker' in the language definition file. Is there a way to enable folding with monaco?

bug

Most helpful comment

Folding is off by default. It can be turned on via editor option folding: true. It defaults to true in vscode and to false in monaco-editor

All 7 comments

I figured there is a generic indentation-based strategy. The documentation of the option says it defaults to true, which isn't the case.

Me also, I'd like to know if it's possible to collapse/uncollapse blocks of code

@alexandrudima or @svenefftinge: am I understanding correctly that as of right now, the standalone Monaco editor does not allow the collapse/uncollapse features that, say, VSCode does?

Folding is off by default. It can be turned on via editor option folding: true. It defaults to true in vscode and to false in monaco-editor

@alexandrudima to clarify, is my understanding correct that nothing in a Monarch language specification allows one to customize code folding behavior outside of the default behavior that you get from folding: true?

@alexandrudima however the api docs here https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditorconstructionoptions.html#folding says it defaults to "true", should that be corrected?

@rikakomoe This has been changed in the meantime and folding does default to true now. i.e. the documentation is correct.

Was this page helpful?
0 / 5 - 0 ratings