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

Fix my opinions #693

Merged
merged 14 commits into from
Nov 18, 2022
Merged

Fix my opinions #693

merged 14 commits into from
Nov 18, 2022

Conversation

imkiva
Copy link
Member

@imkiva imkiva commented Nov 18, 2022

  • Doc.renderXXX now uses the default configuration for each "output target".
  • RenderOptions.render() now renders the Doc with configurable colors and styles.
  • Whenever outputting to a terminal, use AdaptiveCli (by default) or UnixTermStylist (if either color or style is changed), which is guaranteed now by RenderOptions.stylist() and RenderOptions.defaultStylist()
  • AdaptiveCli is now a standalone Stylist (instead of a StyleFamily)
  • Stylist can be viewed as the frozen Sig CS ** SF ** OutputTarget, while RenderOptions reads user-configured CS and SF and create the Stylist according to "output target".

@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Merging #693 (c3f50a5) into main (32eab2a) will increase coverage by 0.03%.
The diff coverage is 61.38%.

@@             Coverage Diff              @@
##               main     #693      +/-   ##
============================================
+ Coverage     78.87%   78.90%   +0.03%     
- Complexity     2875     2884       +9     
============================================
  Files           260      261       +1     
  Lines          9471     9485      +14     
  Branches       1178     1179       +1     
============================================
+ Hits           7470     7484      +14     
+ Misses         1376     1371       -5     
- Partials        625      630       +5     
Impacted Files Coverage Δ
cli/src/main/java/org/aya/cli/Main.java 0.00% <0.00%> (ø)
cli/src/main/java/org/aya/cli/render/Color.java 57.57% <ø> (ø)
...java/org/aya/cli/render/adapter/EitherAdapter.java 32.25% <ø> (ø)
...ain/java/org/aya/cli/render/vscode/ColorTheme.java 84.90% <ø> (ø)
.../java/org/aya/cli/render/vscode/VscColorTheme.java 92.85% <ø> (ø)
...i/src/main/java/org/aya/cli/repl/ReplCommands.java 22.03% <ø> (ø)
...aya/pretty/backend/string/StringPrinterConfig.java 100.00% <ø> (+12.50%) ⬆️
.../src/main/java/org/aya/pretty/printer/Stylist.java 100.00% <ø> (+50.00%) ⬆️
...main/java/org/aya/pretty/style/AyaColorScheme.java 100.00% <ø> (ø)
...main/java/org/aya/pretty/style/AyaStyleFamily.java 100.00% <ø> (ø)
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@imkiva imkiva marked this pull request as ready for review November 18, 2022 14:07
@imkiva imkiva added this to the v0.24 milestone Nov 18, 2022
@imkiva imkiva linked an issue Nov 18, 2022 that may be closed by this pull request
HoshinoTented
HoshinoTented previously approved these changes Nov 18, 2022
Copy link
Contributor

@HoshinoTented HoshinoTented left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

cli/src/main/java/org/aya/cli/render/RenderOptions.java Outdated Show resolved Hide resolved
ice1000
ice1000 previously approved these changes Nov 18, 2022
@ice1000
Copy link
Member

ice1000 commented Nov 18, 2022

bors r+

bors bot added a commit that referenced this pull request Nov 18, 2022
693: Fix my opinions r=ice1000 a=imkiva

- `Doc.renderXXX` now uses the default configuration for each "output target".
- `RenderOptions.render()` now renders the `Doc` with configurable colors and styles.
- Whenever outputting to a terminal, use `AdaptiveCli` (by default) or `UnixTermStylist` (if either color or style is changed), which is guaranteed now by `RenderOptions.stylist()` and `RenderOptions.defaultStylist()`
- `AdaptiveCli` is now a standalone `Stylist` (instead of a `StyleFamily`)
- `Stylist` can be viewed as the frozen `Sig CS ** SF ** OutputTarget`, while `RenderOptions` reads user-configured `CS` and `SF` and create the `Stylist` according to "output target". 

Co-authored-by: imkiva <imkiva@islovely.icu>
Co-authored-by: ice1000 <ice1000kotlin@foxmail.com>
@bors
Copy link
Contributor

bors bot commented Nov 18, 2022

Build failed:

@ice1000
Copy link
Member

ice1000 commented Nov 18, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 18, 2022

Build succeeded:

@bors bors bot merged commit 8b774f0 into main Nov 18, 2022
@bors bors bot deleted the jline branch November 18, 2022 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@imkiva's opinions
3 participants