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 {