Open Ptival opened 1 year ago
Yes I've been meaning to support this!
I think we should do the following:
PrettyParams
datatype in UVMS/Lib/Pretty/Doc.hs
a new parameter; suggestions for the name of the parameter welcome, but first candidates that come to mind are annotationFormat
, metaFormat
and auxiliaryFormat
.BG grayLight
ppLineNumFmt
and ppLineNum
that wrap around this parameter, the way those functions do for lineNumberFormat
Additionally, I'd love a solution that automatically scrapes an environment variable to determine whether or not the terminal is in light or dark mode (there is an env variable for this, right?) I'm not sure the right place to put this logic, here are some options that come to mind:
io_UNSAFE
) in the definition of prettyParams₀
(this is I think my preference)initUVMHS
in UVMHS/Core/IO.hs
; we could put it thereppRenderWith
in UVMHS/Lib/Pretty/RenderANSI.hs
may be a good candidate; it's already scraping a global flag for enabling/disabling color...gv_PPRINT_COLOR
is a magic global variable that changes the behavior of ppRenderWith
, we could have gv_PPRINT_DARKMODE
that does the same. The advantage of this is you could override its value in code, e.g., if you wanted to hardcode output for light/dark mode and not pull the value from an environment variable (which should be its initial value).Oh, and I left this implied but forgot to write it down... once we have good support for switching between light/dark mode, we'll want a good default prettyParams₀
for dark mode.
The following create a couple of issues:
https://github.com/uvm-plaid/uvmhs/blob/a0ac0d780499d2a47906a10896c5d601d45b9903/src/UVMHS/Lib/Parser/ParserContext.hs#L48
In this screenshot, both effects can be seen, the double quotes, as well as the
let
keyword, are barely legible.I feel like this ought to be configured via PrettyParams, so that users can at least override it.