@@ -551,6 +551,7 @@ or removing a command fails until the table changes in the same commit.
551551| ` processLifecycle.inventory ` | Group a process snapshot of one Lithe instance into terminals, Agent tasks and background services |
552552| ` processLifecycle.settle ` | Turn confirmation answers into what ends, what is kept and the updated settings |
553553| ` markdown.render ` | Renders and sanitizes shared Markdown |
554+ | ` markdown.outline ` | Outlines the headings of shared Markdown as a document-symbol tree |
554555| ` markdown.resolveReference ` | Decides what a link or an image of a rendered Markdown document points at |
555556| ` keymap.parseContext ` | Compile a bounded boolean shortcut context (from ` lithe-core-rules ` ) |
556557| ` keymap.evaluateContext ` | Evaluate a precompiled shortcut context (from ` lithe-core-rules ` ) |
@@ -5559,6 +5560,42 @@ load what this command refuses.
55595560Shared examples: ` rust/fixtures/editor/markdown-render-v1.json ` ,
55605561` markdown-html-v1.json ` and ` markdown-rich-content-v1.json ` .
55615562
5563+ ### Markdown heading outline
5564+
5565+ ` markdown.outline ` accepts ` { "source": "<Markdown text>" } ` and returns
5566+ ` { "symbols": [...] } ` , the headings of the source as a tree in the normalized
5567+ document-symbol shape ` lsp.request ` returns for ` textDocument/documentSymbol ` .
5568+ Hosts show it where they show a language server's symbols, so a Markdown file
5569+ has a structure without a language server, and it lists the headings the
5570+ preview's outline lists: the source is parsed with the dialect of
5571+ ` markdown.render ` .
5572+
5573+ - Every heading Comrak parses is listed in document order, including ATX and
5574+ setext headings inside block quotes, lists and alerts. Front matter, code and
5575+ raw HTML headings such as ` <h2> ` are not headings.
5576+ - ` name ` is the heading's text as the preview shows it: text, inline code, math
5577+ literals and shortcode emoji, without images, footnote references and HTML
5578+ tags, with each run of whitespace collapsed to one space and the ends trimmed.
5579+ A heading whose name is empty is left out, and its section belongs to the
5580+ heading before it.
5581+ - A heading is a child of the nearest heading before it with a lower level, so a
5582+ skipped level nests one step.
5583+ - ` kind ` is ` 15 ` (` SymbolKind.String ` , as editors mark Markdown headings);
5584+ ` detail ` and ` containerName ` are ` null ` , ` tags ` is empty and ` deprecated ` is
5585+ ` false ` .
5586+ - Positions are zero-based lines and UTF-16 columns (` { line, utf16Column } ` );
5587+ ` \n ` , ` \r\n ` and a lone ` \r ` end a line. ` selectionRange ` covers the heading
5588+ from its first character to just after its last, a setext heading's underline
5589+ included. ` range ` is its section: from the start of its first line to the start
5590+ of the line of the next heading of the same or a higher level, or to the end of
5591+ the source.
5592+
5593+ Hosts request the outline off their window thread, discard a response to an
5594+ older revision of the source, and bound the source size they send as they bound
5595+ the preview's.
5596+
5597+ Shared examples: ` rust/fixtures/editor/markdown-outline-v1.json ` .
5598+
55625599### Structured logging of recoverable LSP maintenance warnings
55635600
55645601` lsp.pollEvents ` log observations may carry the existing ` error ` object even at
0 commit comments