-
Notifications
You must be signed in to change notification settings - Fork 52
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
Make pretty Terms format prettier #1464
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, it's exactly the kind of thing I had in mind. Thanks for figuring out the right combinators to use etc.
The CI is failing because the formatting of terms has changed in a few error messages. It looks like the messages are long and then have a term on the end, so the pretty-printer is inserting newlines, but this looks bad, e.g.
1:9: Invalid atomic block: def, let, and lambda are not allowed: \c. c;
c
I think we should change it to put a newline before the (indented) term, e.g.
1:9: Invalid atomic block: def, let, and lambda are not allowed:
\c. c; c
As for #1459 , that one will require more work/thought, since as you point out, it is not valid to e.g. insert force
when formatting. So I think we should just go ahead and merge this.
It gets grouped and does not overflow on next line.
@byorgey meanwhile, I came up with a different solution - add backticks to code in error messages (as we already did for some) and group it, so it tends to stay on one line. Thinking about it, we could experiment with |
Instead of enclosing in single or triple backticks etc., it would also be fun to play with using the "annotations" feature to do syntax highlighting etc. for error messages, just like we do for entity descriptions etc. But we can leave that for another PR. |
The descriptions should be OK again. Hopefully it was the only visible bug. 😅 FYI: After this lands, to get the one line effect use inline-code (
|
@xsebek looks good to me! I like how you handled the issue with code formatting in descriptions by distinguishing between single and triple backticks. |
Example using
--format
from #1459: