Skip to content

Clamp Markdown root-heading ranges to the actual file #4910

Description

@Widthdom

Summary

CHANGELOG has 12,648 lines but its root heading is indexed with end_line:12649, exceeding the source file.

Audit IDs: R-14. Reproduced with locally built cdidx v1.40.3 at 404db09489c305f17d94f37026e00564d3ac527a.

Existing issue relationship

No exact existing issue was found.

Expected behavior and PR scope

Markdown heading ranges must respect one consistent inclusive/exclusive convention and never exceed the actual last source line. Keep this to heading EOF/range calculation.

Implementation guide for Codex 5.6 sol xhigh

  • Define behavior for newline-terminated versus non-terminated files and convert parser offsets once.
  • Cover root and nested headings, empty/one-line files, final headings with/without body, CRLF/LF, and very large files.
  • Verify symbols, outline, excerpt/definition ranges, and LSP conversion.
  • Avoid special-casing CHANGELOG size/name.
  • Add focused positive/negative regression tests, run the full net8.0 and net9.0 suite, and add the required bilingual changelog.d/unreleased/ fragment.

Acceptance criteria

  • No heading end line exceeds total lines.
  • Root/final heading bodies include exactly the intended lines.
  • Line-ending variants produce equivalent logical ranges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codebugSomething isn't workingdocumentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions