Missing step in Developer Docs for CodeMirror: StateField to DecorationSet

I am so utterly confused by the Obsidian developer docs for CodeMirror state fields. Editor extensions tells you to make a StateField with a number data type. Then the next part, Decorations tells you that the only way to actually change the appearance is by creating a StateField with the DecorationSet data type. How do I create a StateField with my own data type that then provides decorations?

Can these docs be improved to explain this step???

The docs have a GitHub repo (linked at the bottom of the homepage) where you can file an issue about this.

2 Likes