Skip to content

fix: guard text-only item ranges - #195

Merged
vycdev merged 2 commits into
vycdev:developfrom
vycdev2:fix/guard-text-only-item-ranges
Aug 10, 2026
Merged

fix: guard text-only item ranges#195
vycdev merged 2 commits into
vycdev:developfrom
vycdev2:fix/guard-text-only-item-ranges

Conversation

@vycdev2

@vycdev2 vycdev2 commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • Guard Todo item line/range access when items are parsed from raw text without a VS Code TextDocument.
  • Preserve line-backed item positions when no regex match range exists.
  • Keep match-text extraction compatible with the repository's TypeScript test path.
  • Add regression coverage and document the user-visible fix.

Verification

  • The new focused regression test failed before the implementation because range access attempted to call document APIs on a null document.
  • npx mocha -r ts-node/register test/item.spec.ts --exit — passed.
  • npm test — passed (135 tests).
  • npm run compile — passed.
  • npm run format:check — passed.
  • git diff --check — passed.
  • Immediate pre-publication duplicate searches returned no matching open issue or PR.

Risk

  • Low: document-backed items retain their existing position calculation; only raw-text and line-only fallback paths change.

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

@vycdev
vycdev merged commit 16c3b11 into vycdev:develop Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants