Remove the dependency on legacy ansi-wl-pprint - #2363
Open
felixonmars wants to merge 1 commit into
Open
Conversation
The ansi-wl-pprint < 1 constraint keeps Elm tied to the old 0.6 implementation and blocks dependency upgrades. Move to prettyprinter, using its compatibility package to retain the existing document API and rendering calls. Require compatibility version 1.1 for its fix to renderPretty's ribbon fraction handling. The JSON renderer inspects the old SGR-based SimpleDoc representation, so adapt it to prettyprinter's annotation stream while retaining the JSON schema and color names. Reuse AnsiStyle composition to track nested styles and allow the compatibility module's deprecation warnings under -Werror. Tested the equivalent 0.19.1 patch against the original renderer and ansi-wl-pprint 0.6.9 using 5,580 AI-generated test cases, including 25 parser diagnostics. 5,506 JSON outputs match exactly; differences are trailing whitespace and four legacy style cases unused by Elm. All JSON outputs agree with native ANSI rendering, and eight terminal cases have identical output and exit status. A full build succeeded on Arch Linux with GHC 9.6.6.
|
Thanks for suggesting these code changes. To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources. |
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.
Quick Summary:
The ansi-wl-pprint < 1 constraint keeps Elm tied to the old 0.6 implementation and blocks dependency upgrades. Move to prettyprinter, using its compatibility package to retain the existing document API and rendering calls. Require compatibility version 1.1 for its fix to renderPretty's ribbon fraction handling.
The JSON renderer inspects the old SGR-based SimpleDoc representation, so adapt it to prettyprinter's annotation stream while retaining the JSON schema and color names. Reuse AnsiStyle composition to track nested styles and allow the compatibility module's deprecation warnings under -Werror.
Tested the equivalent 0.19.1 patch against the original renderer and ansi-wl-pprint 0.6.9 using 5,580 AI-generated test cases, including 25 parser diagnostics. 5,506 JSON outputs match exactly; differences are trailing whitespace and four legacy style cases unused by Elm. All JSON outputs agree with native ANSI rendering, and eight terminal cases have identical output and exit status.
A full build succeeded on Arch Linux with GHC 9.6.6.
Additional Details
n/a