feat(es): Add source map support for --cg javascript backend#3714
Open
shogochiai wants to merge 1 commit intoidris-lang:mainfrom
Open
feat(es): Add source map support for --cg javascript backend#3714shogochiai wants to merge 1 commit intoidris-lang:mainfrom
shogochiai wants to merge 1 commit intoidris-lang:mainfrom
Conversation
Add source map generation for the JavaScript/Node.js code generator, enabling better debugging of Idris2 code in browser DevTools and Node.js. Changes: - Add Compiler.ES.SourceMap module with VLQ encoding and source map generation - Integrate source map generation into ES codegen pipeline - Add "sourcemap" directive to enable source map output - Add SourceMap module to idris2api.ipkg for external tool access Tests (implemented in Idris2 following existing test patterns): - tests/node/sourcemap001: Basic source map generation for node backend - tests/node/sourcemap_e2e001: E2E verification with complex Idris2 code - tests/node/sourcemap_accuracy001: Mapping accuracy verification - tests/codegen/sourcemap_js001: Basic source map for javascript backend - tests/codegen/sourcemap_js_e2e001: E2E verification for browser target Usage: idris2 --cg node --directive sourcemap -o output Main.idr 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
bc8d0e9 to
b27ae31
Compare
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
Add source map generation for the JavaScript/Node.js code generator, enabling better debugging of Idris2 code in browser DevTools and Node.js.
Compiler.ES.SourceMapmodule with VLQ encoding and source map generationsourcemapdirective to enable source map outputidris2api.ipkgfor external tool accessUsage
Tests
All tests are implemented in Idris2, following existing test patterns (e.g.,
tests/codegen/enum):tests/node/sourcemap001: Basic source map generation for node backendtests/node/sourcemap_e2e001: E2E verification with complex Idris2 codetests/node/sourcemap_accuracy001: Mapping accuracy verificationtests/codegen/sourcemap_js001: Basic source map for javascript backendtests/codegen/sourcemap_js_e2e001: E2E verification for browser targetTest plan