Repository navigation
fix(cm): rebuild bounded fields when a link reference or a far indent re-shapes a list - #484
Merged
Merged
Conversation
… re-shapes a list The shared structural guard missed a link reference definition forming or dissolving (`[a]: /url` <-> `[a]; /url`), which flips whether following indented blocks continue a list item. A new shared linkReferenceRisk check scans the edit's nonblank run so edits inside multi-line labels and titles are covered too. The fenced-code collapse guard missed a far indent change flipping an indented fence between ListItem and Document; topLevelBoundaryRisk now also fires on an indent delta and on link-reference risk, still scoped outside existing fence records so in-fence editing stays bounded. Both regressions, plus the leading-frontmatter fence case from #479, are now in the exhaustive corpus / fenced bounded-equals-full tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes two guard regressions in the changed-range-bounded StateFields: the shared structural guard missed link reference definitions forming/dissolving, and the fenced-code collapse guard missed far indent changes that flip an indented fence between
ListItemandDocument.Changes
src/webview/cm/link-reference-risk.ts: scans the edit's nonblank run for a possible (container-relative)[leaf start on either side of the edit, so edits inside multi-line labels/titles are covered. Shared by both guards.structural-guard.ts: new LINK-REFERENCE arm intouchesStructuralReparse(after NEWLINE/GT deltas, before TABLE-DELIM).fenced-code-collapse.ts:topLevelBoundaryRisknow also fires on an indent delta and on link-reference risk; theinsideBlockscoping moved first so in-fence edits stay bounded. The fencedSTRUCTURALregex stays narrow.[a]: /url/[a]; /urlpair (both directions) and a leading-frontmatter fence document added toSHAPE_CORPUS; indent dedent→reindent case plus an explicit frontmatter no-collapse assertion incm-fenced-collapse-bounded.test.ts; one callout bounded≡full case.[-led code lines in the same nonblank run take the full walk. Inline images stay bounded.Related
Test Plan
pnpm compile🤖 Generated with Claude Code
https://claude.ai/code/session_01XMxzpcgXWjg2R55jytCAxG