I am building a kinf of linter. I can have errors containing other errors. I am hence using nested decorations.
Each decoration has its own CSS class and also contain a data-error giving mode details about the error.
While the CSS class is properly assigned, the data-error is not set on nested decoration.
I think the attributes are merged, since when multiple inline decorations apply to a given bit of content, they are combined, and since the library doesn’t know how to union any attributes other than class and style, it’ll just pick one value if more than one is provided.
You can’t, really. That’s not configurable at the moment, and doesn’t seem like a very obvious thing to add. Are you using these for some kind of tooltip? Would it work to store the messages elsewhere and have the tooltip read them from there?
The best way is probably a plugin state field, which tracks the ranges (or even uses the DecorationSet to do so by adding an additional property to your decoration spec objects, using the find method to find decorations at a given position, and combining their messages somehow.