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

codespan-reporting layout #14

Open
wants to merge 10 commits into
base: custom-layouts
Choose a base branch
from

Conversation

ruifengx
Copy link

Closes #11.

@ruifengx
Copy link
Author

ruifengx commented Oct 21, 2022

For completeness, here are two "screenshots" 1 of the test suite:

With Unicode Without Unicode
unicode ascii

Footnotes

  1. I used term-transcript-cli for the SVG screenshot. The command line is the following: cat {unicode,ascii}.txt | term-transcript capture "stack test # with[out] Unicode" -o {unicode,ascii}.svg --palette powershell --no-wrap.

@Mesabloo Mesabloo self-requested a review November 5, 2022 08:52
@Mesabloo Mesabloo self-assigned this Nov 5, 2022
@Mesabloo Mesabloo added the enhancement New feature or request label Nov 5, 2022
@Mesabloo
Copy link
Owner

Mesabloo commented Nov 5, 2022

There's a lot to unpack here.
Let's check bit by bit.
I'll comment directly here and there (and maybe request some chnages) while reviewing the code.


This is an implementation of a custom layout for Diagnose, heavily inspired by [`codespan-reporting`](https://github.com/brendanzab/codespan).

TODO: add example rendering
Copy link
Owner

Choose a reason for hiding this comment

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

I see this has not yet been replaced.
Should I add examples myself (for consistency with other screenshots)?

Copy link
Author

Choose a reason for hiding this comment

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

Ah, I totally forgot about this. If you could point me to the code responsible for generating the example, I can add the screenshots here. By the way, I think SVG screenshots (as shown in my previous comments in this PR) might have better display quality (and also smaller in size); I can replace other screenshots to use SVG format if you want (I already have the tool installed so it might be more convenient to do it on my side).

@Mesabloo
Copy link
Owner

Mesabloo commented Nov 5, 2022

Overall, this should be almost ready to merge.

The code is however quite "blocky", as in there are big chunks of code with no empty lines.
I personally find it easier to read if there is a bit of space here and there (see how spaces out my code is), but this may only be a matter of taste.

Would you be willing to maintain this new package? I'd be grateful. :D

@ruifengx
Copy link
Author

ruifengx commented Nov 5, 2022

The code is however quite "blocky", as in there are big chunks of code with no empty lines.
I personally find it easier to read if there is a bit of space here and there (see how spaces out my code is), but this may only be a matter of taste.

I agree. Ideally I would break those long functions into smaller ones, with descriptive names and only a few local bindings, but passing around the configurations (like "width of the line number section" etc.) would also clutter the code, so I left it as is. I will have a look at your implementation and add more spacing (or even better, more comments). This shouldn't take long.

Would you be willing to maintain this new package? I'd be grateful. :D

My pleasure. Should any issue arises, ping me and I will try to address them ASAP.

@Mesabloo Mesabloo linked an issue Nov 5, 2022 that may be closed by this pull request
@Mesabloo
Copy link
Owner

Hello @ruifengx, it's been quite a while.
Do you have any update on this, any work left in commits not pushed?

@ruifengx
Copy link
Author

Sorry about this. I should have at least left a note here. A quick summary of the current situation: I have some code clean up for the implementation (because I am not entirely satisfied about the current mess), but they are not yet committed/pushed. The second half of this semester was unexpectedly busy for me, so I did not have enough time to finish the rewrite, despite that this PR did occur to me quite a few times. I apologise for keeping you waiting, and I do hope to bring a good ending for this PR. I will try to pick up from where I left with my local edits and push an update here soon.

@Mesabloo
Copy link
Owner

Hey no worries! I'm also quite busy (hence the fact that I'm popping a message here only now) so it'll take a bit of time to continue reviewing the code anyway. Keep up the good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alternative codespan-reporting style formatting?
2 participants