Skip to content

refactor(source-map): extract code segment reconstruction - #91

Merged
luojiyin1987 merged 1 commit into
masterfrom
agent/extract-code-segment-reconstruction
Aug 10, 2026
Merged

refactor(source-map): extract code segment reconstruction#91
luojiyin1987 merged 1 commit into
masterfrom
agent/extract-code-segment-reconstruction

Conversation

@luojiyin1987

@luojiyin1987 luojiyin1987 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Move code block source-map reconstruction into src/source-map/code-segments.ts.
  • Export only buildCodeSegments from the new module.
  • Keep one buildCodeSegments(md, node) call in build-source-map.ts.

Why

Code block mapping is one independent algorithm domain.

This extraction gives it one module seam. It also reduces the responsibilities of build-source-map.ts.

Scope

  • No algorithm changes.
  • No performance changes.
  • No test structure changes.
  • No URL or inline-code extraction.
  • No recordingExtension changes.
  • No public interface changes.

Verification

  • The moved 424-line implementation is byte-for-byte identical after import and export normalization.
  • pnpm run prepublishOnly passed.
  • All 14 test suites passed.
  • All 1,956 tests passed.
  • Type tests, ESLint, build, and package checks passed.
  • pnpm run bench:source-map completed.

This PR follows the event-local state work in #87, #88, and #89.

Closes #92

@luojiyin1987
luojiyin1987 marked this pull request as ready for review August 10, 2026 03:29
@luojiyin1987
luojiyin1987 merged commit aecf7a7 into master Aug 10, 2026
13 checks passed
@luojiyin1987
luojiyin1987 deleted the agent/extract-code-segment-reconstruction branch August 10, 2026 03:33
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.

refactor(source-map): extract code segment reconstruction

1 participant