[WIP] Prototype AST rewrite for parameterless witness method#23
Closed
Copilot wants to merge 7 commits into
Closed
[WIP] Prototype AST rewrite for parameterless witness method#23Copilot wants to merge 7 commits into
Copilot wants to merge 7 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
=========================================
Coverage 66.11% 66.11%
Complexity 320 320
=========================================
Files 55 55
Lines 782 782
Branches 65 65
=========================================
Hits 517 517
Misses 219 219
Partials 46 46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Created AstRewriter class to translate InstantiationPlan to JCTree expressions - Created WitnessResolutionPlugin as a javac compiler plugin - Plugin collects witness() calls and replaces them with direct constructor calls - Registered plugin via META-INF/services Co-authored-by: Garciat <118277+Garciat@users.noreply.github.com>
Added compiler configuration to enable the witness resolution plugin during compilation Co-authored-by: Garciat <118277+Garciat@users.noreply.github.com>
- Added parameterless witness() method to TypeClasses - Updated WitnessResolutionPlugin to handle both witness() variants - Parameterless version uses type inference from assignment context - Plugin rewrites both versions to direct constructor calls Co-authored-by: Garciat <118277+Garciat@users.noreply.github.com>
- Replaced two-pass approach with single TreeTranslator - Simplified witness call detection logic - Plugin now rewrites AST in-place during ANALYZE phase - Added test for parameterless witness() method Co-authored-by: Garciat <118277+Garciat@users.noreply.github.com>
Added documentation for the new compile-time witness() method and compiler plugin Co-authored-by: Garciat <118277+Garciat@users.noreply.github.com>
- Improved stream to list conversion in AstRewriter - Replaced System.err logging with javac diagnostic API - Added compilation unit tracking for proper diagnostic reporting Co-authored-by: Garciat <118277+Garciat@users.noreply.github.com>
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.
Implementation Plan: AST Rewrite for Parameterless witness()
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.