Skip to main content

HIGHLIGHTS_QUERY

Constant HIGHLIGHTS_QUERY 

Source
pub const HIGHLIGHTS_QUERY: &str = "; Mosaic syntax highlights.\n;\n; Capture names follow Zed\'s supported syntax capture set. When a node has\n; fallback captures, Zed resolves them right-to-left.\n\n; --- Comments ---------------------------------------------------------------\n\n(comment) @comment\n(shebang) @preproc\n\n; --- Literals ---------------------------------------------------------------\n\n(string) @string\n(escape_sequence) @string.escape\n(number) @number\n(dimension) @number\n(boolean) @boolean\n(null) @constant.builtin\n\n; --- Identifiers (generic fallback; overridden below) -----------------------\n\n(identifier) @variable\n\n; --- Block directives -------------------------------------------------------\n\n; `#set`, `#import`, and `#include` use hidden boundary tokens so `#setpage`\n; stays a generic call. Their visible `#` is highlighted by punctuation below.\n(verse_block \"verse\" @keyword)\n(pre_block \"pre\" @keyword)\n(code_block \"code\" @keyword)\n(linebreak_call \"linebreak\" @keyword)\n\n(set_directive\n  target: (identifier) @type)\n\n(import_directive\n  path: (string) @string @string.special)\n\n(include_directive\n  path: (string) @string @string.special)\n\n; --- Headings ---------------------------------------------------------------\n\n(heading_marker) @punctuation.special\n\n(heading\n  content: (inline_sequence) @title)\n\n; --- Lists ------------------------------------------------------------------\n\n(unordered_list_marker) @punctuation.list_marker\n(ordered_list_marker) @punctuation.list_marker\n\n; --- Inline emphasis --------------------------------------------------------\n\n(emphasis\n  (emph_text) @emphasis)\n\n(strong\n  (emph_text) @emphasis.strong)\n\n(strong_emphasis\n  (emph_text) @emphasis.strong)\n\n; --- Code, math, raw blocks -------------------------------------------------\n\n(code_span\n  (code_text) @text.literal)\n\n(code_span\n  (code_escape) @text.literal)\n\n(inline_math) @text.literal\n(verse_block) @text.literal\n(raw_body_open) @punctuation.special\n(raw_body_content) @text.literal\n(raw_body_close) @punctuation.special\n\n; --- Labels & references ----------------------------------------------------\n\n(block_label) @label\n(label\n  name: (label_name) @label)\n\n(citation) @link_text\n(citation\n  target: (label_name) @string.special.symbol)\n\n(reference) @link_text\n(reference\n  target: (label_name) @string.special.symbol)\n\n(page_reference) @link_text\n(page_reference\n  target: (label_name) @string.special.symbol)\n\n; --- Escapes ----------------------------------------------------------------\n\n(escaped_char) @string.escape\n(hard_break) @string.escape\n(soft_hyphen_escape) @string.escape\n\n; --- Calls (override @variable on the function identifier) ------------------\n\n(hash_call\n  function: (qualified_name) @function)\n\n(call_expr\n  function: (qualified_name) @function)\n\n(linebreak_call) @function\n\n(attribute\n  key: (identifier) @property)\n\n; --- Punctuation ------------------------------------------------------------\n\n\"#\" @punctuation.special\n\"@\" @punctuation.special\n\"$\" @punctuation.special\n\n[\n  \"*\"\n  \"**\"\n  \"***\"\n] @punctuation.special\n\n[\n  \"<\"\n  \">\"\n] @punctuation.bracket\n\n[\n  \"(\"\n  \")\"\n  \"[\"\n  \"]\"\n  \"{\"\n  \"}\"\n] @punctuation.bracket\n\n[\n  \",\"\n  \":\"\n  \".\"\n] @punctuation.delimiter\n";
Expand description

The syntax highlighting query for this grammar.