Skip to content

fix(source-map): fixes wrong source end offset#296

Merged
johnsoncodehk merged 2 commits intovolarjs:masterfrom
leonidaz:master
Jan 31, 2026
Merged

fix(source-map): fixes wrong source end offset#296
johnsoncodehk merged 2 commits intovolarjs:masterfrom
leonidaz:master

Conversation

@leonidaz
Copy link
Copy Markdown
Contributor

@leonidaz leonidaz commented Dec 21, 2025

closes #295

  • Provides contextual info for the function translateOffset() to prefer selecting the longer source offset based on the length when translating generated to source offsets for the end source position.
  • Modifies findMatchingStartEnd() to provide this context only when calculating the source's end position and only when performing the generated to source translation.
  • Only gets triggered if generatedLengths is provided in tokens.

@johnsoncodehk johnsoncodehk merged commit c627ce0 into volarjs:master Jan 31, 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.

Mapping when tokens in source code are longer than in the generated produces wrong end position based on the shortest generated token

2 participants