I have an extension which adds decorations based on the syntax tree. I’d like to be able to decorate some ranges with borders or border radiuses (or any other rendering where the start and end of the node is important), but there are conflicts with other extensions which can decorate these elements as well (like search, bracket matching, and selection matches).
Even if my extension has a lower precedence, the decorated range can end up getting ‘split’:
example with the word hello
decorated and a selection match:
extensions: [
Prec.low(MyDecorator)
Prec.high(highlightSelectionMatches())
]
<span class="my-decoration">
he
</span>
<span class="my-decoration">
<span class="cm-selectionMatch">l</span>
lo
</span>
But it seems like the more logical result (and the one I’d want) would be:
<span class="my-decoration">
he
<span class="cm-selectionMatch">l</span>
lo
</span>
Is there a way to have that behavior currently? Is the current behavior by design (and needed for some other reason), or is it unintentional and not important usually?
Related: The search module doesn’t export its extensions, and the searchHighlighter
extension is configured to lowest precedence. While the extensions could be changed to either export the necessary extensions or allow the precedence to be configurable, is there a way that I can override that precedence in my own code instead?