From b16b096744997360b48368e87f963f7cdee34bb0 Mon Sep 17 00:00:00 2001 From: claude Date: Mon, 8 Jun 2026 09:03:43 +0000 Subject: [PATCH] projection: visit overlay/mounted subtrees during tree iteration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit yamlFrontmatter() embeds the Markdown content as an overlay on the top-level YAML-frontmatter tree. The previous mode (IgnoreMounts | IgnoreOverlays) skipped that overlay entirely, so ATXHeading nodes were never visited and the Quarto (.qmd) file outline was always empty. Dropping the mode flag lets the iterator descend into overlay and mounted subtrees. This is safe because every enterNode function already filters by node name — visiting extra nodes from foreign-language mounts is a no-op. Co-Authored-By: Claude Sonnet 4.6 --- .../source-editor/utils/tree-operations/projection.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/web/frontend/js/features/source-editor/utils/tree-operations/projection.ts b/services/web/frontend/js/features/source-editor/utils/tree-operations/projection.ts index 89681491e5..2be82c405a 100644 --- a/services/web/frontend/js/features/source-editor/utils/tree-operations/projection.ts +++ b/services/web/frontend/js/features/source-editor/utils/tree-operations/projection.ts @@ -1,6 +1,6 @@ import { ensureSyntaxTree } from '@codemirror/language' import { EditorState, Transaction } from '@codemirror/state' -import { IterMode, SyntaxNodeRef } from '@lezer/common' +import { SyntaxNodeRef } from '@lezer/common' const TWENTY_MS = 20 const FIVE_HUNDRED_MS = 500 @@ -144,7 +144,11 @@ export function getUpdatedProjection( } return enterNode(state, node, items, nodeIntersectsChange) }, - mode: IterMode.IgnoreMounts | IterMode.IgnoreOverlays, + // Do not pass IgnoreMounts or IgnoreOverlays: mixed-language parsers + // (e.g. yamlFrontmatter wrapping Markdown) embed the content language + // as an overlay, and skipping overlays would hide all heading nodes. + // enterNode functions filter by node name, so visiting extra nodes from + // mounts/overlays in other languages is harmless. }) // We know the exact projection. Return it. return {