Minga.Language.Highlight.InjectionRange (Minga v0.1.0)

Copy Markdown View Source

A tree-sitter injection range marking an embedded language region.

When a file contains multiple languages (e.g., HTML with embedded JavaScript, Elixir with HEEx templates), tree-sitter reports injection ranges that map byte offsets to the injected language name. These flow from the parser Port through the protocol layer and are stored on editor state for comment toggling and other language-aware operations.

Summary

Types

t()

An injection range.

Functions

Creates a new injection range.

Types

t()

@type t() :: %Minga.Language.Highlight.InjectionRange{
  end_byte: non_neg_integer(),
  language: String.t(),
  start_byte: non_neg_integer()
}

An injection range.

Functions

new(start_byte, end_byte, language)

@spec new(non_neg_integer(), non_neg_integer(), String.t()) :: t()

Creates a new injection range.