Skip to content
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

Add Doc parameters and overhaul rendering options #80

Merged
merged 2 commits into from
May 31, 2024

Conversation

DavidGregory084
Copy link
Member

@DavidGregory084 DavidGregory084 commented May 29, 2024

This PR adds Doc.param, which can be used to introduce named parameters into prettier4j's Doc.

These named parameters must be bound using Doc#bind before rendering.

This is useful when using Doc to represent error messages which contain pretty-printed elements like source code snippets or in type errors when printing out actual and expected types, as it allows an instance of Doc with placeholders to be declared and later bound with parameters for rendering.

It also overhauls rendering options in an attempt to avert any further changes to the render functions as more options are added.

@codecov-commenter
Copy link

codecov-commenter commented May 29, 2024

Codecov Report

Attention: Patch coverage is 88.18182% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 96.83%. Comparing base (61667de) to head (c67ffd5).

Files Patch % Lines
...main/java/com/opencastsoftware/prettier4j/Doc.java 85.55% 12 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #80      +/-   ##
============================================
- Coverage     97.78%   96.83%   -0.95%     
- Complexity      211      236      +25     
============================================
  Files            10       11       +1     
  Lines           632      727      +95     
  Branches        109      125      +16     
============================================
+ Hits            618      704      +86     
- Misses            6       18      +12     
+ Partials          8        5       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DavidGregory084 DavidGregory084 marked this pull request as ready for review May 31, 2024 00:52
@DavidGregory084 DavidGregory084 merged commit 6c72ec5 into main May 31, 2024
2 checks passed
@DavidGregory084 DavidGregory084 deleted the parameterized-docs branch May 31, 2024 23:11
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.

2 participants