Not directly using the editor’s syntax highlighting. Though I guess you could run highlightTree on the subtree for the text inside the widget, feeding it the same highlighters that your editor uses, and then construct the highlighted DOM directly and put that in the widget.
Thank you, @marijn.
This is a component of @lezer/highlight, right? I am just a bit confused.
and if it is true, then, I can construct something like this (first answer)
You could apply marker widgets to the content you want to alter, and put empty replace widgets on the stuff you want to hide, skiping the whole need to redecorate it inside a new widget.
To fully support the recursion for widgets I was thinking, would it be a bad idea to start a separate instances of CM6 view inside the widget? For example of I have a widget of a matrix, where each cell is a separate CM6 editor. Then I can make matrixes inside matrixes and so one