Skip to content

SEMANTIC_TOKEN_Z_INDEX

const SEMANTIC_TOKEN_Z_INDEX: 2 = 2

Where the semantic layer sits in the shared highlight priority space.

Priority only decides between highlights that declare the same property — the CSS Custom Highlight API resolves per property — so the only contest here is for color, and five producers declare one: syntax token highlights at 0, bracket depth colouring at 1, this layer, an error diagnostic, and the current find match. Semantic colour must beat the syntactic colour it refines and the depth colour that refines it in turn, and must lose to an error squiggle and to the current find match, which are both answers to a question the user just asked.

Two rather than one because bracket depth colouring already held one, and a tie in this namespace is resolved by registry insertion order — which is the defect the band exists to remove, not a place to leave one. packages/lsp-plugin/test/highlightPriority.test.ts holds the whole order.