ascii-canvas icon indicating copy to clipboard operation
ascii-canvas copied to clipboard

Migrate to Anstyle

Open Pat-Lafon opened this issue 1 year ago • 6 comments

This is a first pass at moving away from term. It compiles but I haven't actually looked too much into what styling happens.

One nice thing is that now many of the bounds are now based on the standard library like std::io::{Write, Result} instead of Terminal + ?Sized or term::Result.

The way styles are applied is a little different, but all of the colors and most of the styles are basically the same. Note Standout which i think is equivalent to anstyle::Effects::BOLD | anstyle::Effects::INVERT but not 100% clear on that.

This crate has very few tests which makes these kinds of updates a little risky imo though I don't think the diff is too big that we can't go through it thoroughly and maybe add some insta snapshot testing.

Pat-Lafon avatar May 26 '24 19:05 Pat-Lafon

@lalrpop/maintainers Looking for a review and also noting that I don't seem to have write access despite being a lalrpop member... that's fine but hopefully someone active does for when this is good to go.

Pat-Lafon avatar May 26 '24 19:05 Pat-Lafon

Will close #4 and a pre-req for https://github.com/lalrpop/lalrpop/issues/856

Pat-Lafon avatar May 26 '24 19:05 Pat-Lafon

@Pat-Lafon you (and other @lalrpop/maintainers) should now have write access, sorry about that

nikomatsakis avatar May 27 '24 10:05 nikomatsakis

This would help our project if it were merged. Is this blocked?

BenjaminBrienen avatar Apr 11 '25 22:04 BenjaminBrienen

At least from my perspective, I'm hoping @Pat-Lafon will answer my questions here before I do another review pass.

I agree with your desire to get this merged.

dburgener avatar Apr 12 '25 12:04 dburgener

The original set of tests don't take into account style/color. I've poked at this enough so that I can write some expect-tests for the current behavior when it comes to styling. I want to use that to understand where things might be currently going awry.

Pat-Lafon avatar Apr 13 '25 05:04 Pat-Lafon