Skip to content

Change the intermediate representation for rendering #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged

Conversation

fpringle
Copy link
Owner

@fpringle fpringle commented Apr 8, 2025

Previously we were using a set of intermediate data types as a stepping stone between our strongly-controlled diff result types (DiffResult, DiffErrorNested etc), and our destination render type (a lazy text Builder). The intermediate types were basically untyped versions of our diff result types - in other words, were further towards that end of the scale. In this PR we change the intermediate type to something much closer to the middle.

Doc is a very simple type, allowing rendering to output some lines, plus an optional nested Doc.
In a future PR when we let the user extend our error types with custom diffs, this will help a lot in structuring how they can render those diffs.

@fpringle fpringle self-assigned this Apr 8, 2025
@fpringle fpringle marked this pull request as ready for review April 8, 2025 19:25
@fpringle fpringle merged commit b86b731 into main Apr 8, 2025
10 checks passed
@fpringle fpringle deleted the render-doc branch April 8, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant