Skip to content

refactor(source-map): derive segment offsets from text nodes - #88

Merged
luojiyin1987 merged 1 commit into
masterfrom
agent/source-map-node-offsets
Aug 10, 2026
Merged

refactor(source-map): derive segment offsets from text nodes#88
luojiyin1987 merged 1 commit into
masterfrom
agent/source-map-node-offsets

Conversation

@luojiyin1987

@luojiyin1987 luojiyin1987 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Derive valueStart from the target text node.
  • Initialize segment storage by target node identity.
  • Remove RecordingState.current and RecordingState.len.

Why

The global cursor duplicated data already present on each text node. It also coupled segment offsets to handler order.

Impact

Each text node now owns the data used to calculate its segment ranges. Parser output and source-map behavior stay unchanged.

Checks

  • 1,849 source-map tests passed.
  • pnpm exec tsc --noEmit
  • pnpm run lint

Closes #84
Part of #86

Stack created with GitHub Stacks CLI

@luojiyin1987
luojiyin1987 marked this pull request as ready for review August 10, 2026 02:49
Base automatically changed from agent/source-map-event-metadata to master August 10, 2026 03:04
@luojiyin1987
luojiyin1987 force-pushed the agent/source-map-node-offsets branch from 3961d91 to 22a2106 Compare August 10, 2026 03:04
@luojiyin1987
luojiyin1987 merged commit 68dca22 into master Aug 10, 2026
19 checks passed
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): derive segment offsets from text nodes

1 participant