Command Palette
Search for a command to run...

Region markers

A region is delimited by two marker lines:

docref: begin <name>
docref: end <name>

The tokens may appear anywhere in a line, behind any comment leader. The grammar is therefore language-agnostic without per-language comment parsing:

// docref: begin footnote-ordering
# docref: begin retry-loop
-- docref: begin tenant-scope
<!-- docref: begin nav-skeleton -->

Rules:

  • Recognition pattern: docref:\s*(begin|end)\s+([a-z0-9][a-z0-9-]*).
  • Names are kebab-case and unique per file. A duplicate begin with the same name in one file is an error.
  • end always carries the name. This keeps nested and overlapping regions unambiguous; both are permitted.
  • An unmatched begin or end is an error.
  • The marker lines themselves are excluded from extraction and from hashing.

Symbols need no marker and are the default. Markers are for sub-symbol slices (five specific lines inside a function) or for languages and file types where structural resolution is unavailable.