Skip to content

Semantic tokens: overlapping tokens on the PSI path, and injected fragments #2348

Done

Description

@lagergren

The rest of gap 8 of #2334, which #2338 doesn't cover.

Overlapping tokens on the PSI path

For a plugin's own PSI, the highlighting keeps one semantic token per start offset (LazyHighlightInfo[], indexed by the start offset), so a token that starts where another one starts replaces it without a word.

Injected fragments and template languages

Not checked: injected fragments, and files with several PSI roots, as template languages have. The highlighting may run analyze once per root, and its tokens may land on the wrong root.

Tests

  • Overlapping tokens on a file with its own PSI: both tokens are highlighted, or which one wins is decided and documented.
  • A file with an injected fragment, and one of a template language.

Activity

  1. added this to the 0.30.3 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsemantic tokens

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions