I am working on a mode, and in addition to styling, I want to use the result of the parsing to replace or collapse ranges using doc.markText(…).
Eg/ in my mode I could add a style, say ‘cm-widget-x’, to every contiguous region that I want to replace with ‘widget-x’.
I’m understanding the mode bit, but I haven’t yet found clarity about the best place to hook into CodeMirror to apply markText. Does anyone know where a good place to start might be?