feat(opt-report): show local declaration locations - #7957
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (66)
📝 WalkthroughWalkthroughThe PR records local declaration spans during HIR lowering, preserves them through inlining and loop unrolling, and uses them to populate optimization-report offsets. Text reports now show file, line, column, source snippets, and carets, including corrected CommonJS wrapper locations. ChangesSource-span metadata and lowering
Transform propagation
Optimization reports
Compile integration
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CompilePipeline
participant Codegen
participant HIR
participant Transform
participant OptReport
participant TextRenderer
CompilePipeline->>Codegen: provide module source and line offset
Codegen->>HIR: lower bindings with source spans
HIR->>Transform: pass local-span metadata
Transform->>OptReport: provide remapped local spans
Codegen->>OptReport: register module source
OptReport->>TextRenderer: provide resolved offsets
TextRenderer-->>CompilePipeline: render location, snippet, and caret
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #7036\n\n## Summary\n- retain report-only LocalId -> source-span metadata through HIR lowering and local-cloning transforms\n- populate the existing opt-report byte_offset field for named locals without changing the JSON schema\n- render file:line:column plus source/caret snippets in text reports, including CJS wrapper line correction\n\n## Testing\n- cargo test -p perry-hir --lib\n- cargo test -p perry-transform --lib\n- cargo check -p perry-codegen --tests\n- cargo check -p perry\n\nNo version bump.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation