Storing data as a RangeSet makes (theoretical) sense. However, even after spending a week steeped in the CodeMirror 6 docs, I constantly find myself struggling with the practical implementation.
For example: You recommend using RangeSet.
There aren’t any direct examples of RangeSet I can find, so…
Dig through dozen or more methods to even see the ways to create a RangeSet.
It’s still unclear if I should use new RangeSet(), RangeSet.of(), RangeSet.empty, or if I need to use the completely separate RangeSetBuilder.
After all of that, I still have to figure out:
How to integrate that into StateField
How to properly store data in the RangeSet and StateField
How to loop through the RangeSet to update the position with tr.changes.mapPos
How to get that data back and use it to remove a range of the document.
I’m not complaining about having to learn new concepts, but there are so many disparate concepts/types and so few examples that really showcase how these concepts are supposed to work individually or together.
Some of that will come with time and community, but if there are parts of the documentation or codebase I might be missing that help with understanding how to implement or use them, do let me know.