Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR aims to fix the jump-to-source mapping by exposing richContentFromSourceMap and updating all related code paths and tests to support additional mapping indices.
- Exposes and utilizes richContentFromSourceMap for preview output.
- Adjusts mapping node and source segment structures to include original and IR indices.
- Updates tests and panel functionality to work with the new mapping behavior.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/poml/writer.ts | Updates mapping node creation, source segment handling, and removes internal richContentFromSourceMap in favor of the exported version; adds IR index fields. |
| packages/poml/tests/writer.test.tsx | Adjusts tests to reflect new source mapping fields and updated array structure. |
| packages/poml/tests/index.test.tsx | Updates tests to validate the new writeWithSourceMap behavior. |
| packages/poml/index.ts | Exports updated richContentFromSourceMap along with other core constructs. |
| packages/poml/base.tsx | Adds the new richContentFromSourceMap implementation. |
| packages/poml-vscode/* | Updates imports and usage of richContentFromSourceMap and source map fields in panel and LSP code. |
packages/poml/writer.ts
Outdated
| // mappings. If we cannot find a mapping, use the first one as a fallback. | ||
| chosen = result.mappings[0]; | ||
| } | ||
| console.log(start, end, chosen, chosenOriginal); |
There was a problem hiding this comment.
Remove the debug logging statement before merging to production to avoid unintended console output.
Suggested change
| console.log(start, end, chosen, chosenOriginal); | |
| // Debug logging removed for production. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
richContentFromSourceMapand use it for preview outputdata-source-mapTesting
npm testnpm run test-vscodehttps://chatgpt.com/codex/tasks/task_e_685d1e2d1c00832e8a633d95a4a241f8