I'm using monaco-editor for educational purposes about one topic.
I was trying to fold and unfold specific part of the code to let the user understand what each part of the code do.
For example, I would like to fold all the functions but one and visualize the specific documentation for that function. And so far and so on for all the functions in the code.
They can have different levels of depth.
I'm using this function here but seems to not work. I think I'm not using it properly.
editorRef.current.editor.trigger('fold', 'editor.foldAll');
editor.trigger('unfold', 'editor.unfold', {
levels: 4,
direction: 'down',
selectionLines: [106, 123, 133],
});
Can someone help me?
I expect that monaco-editor reveal the actual function but instead just unfold one level in deepth