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

MietteReporter: Render a "bounding box" when the lines are way too long #20

Open
zkat opened this issue Aug 18, 2021 · 5 comments
Open
Labels
enhancement New feature or request Hacktoberfest Stuff that's good for hacktoberfest contribs help wanted Extra attention is needed

Comments

@zkat
Copy link
Owner

zkat commented Aug 18, 2021

This is going to be hard, but it's going to make out-of-the-box display for, say, a bunch of single-line json, a lot easier.

@zkat zkat added enhancement New feature or request help wanted Extra attention is needed labels Aug 18, 2021
@zkat zkat mentioned this issue Sep 10, 2021
14 tasks
@zkat zkat added the Hacktoberfest Stuff that's good for hacktoberfest contribs label Oct 1, 2021
@jdonszelmann
Copy link
Contributor

Could you elaborate on how you envisioned this? Is this still something you want?

@ysthakur
Copy link

Would this only involve trimming snippets horizontally like they're currently trimmed vertically (like @Benjamin-L said here (sorry for the ping)) or would it involve wrapping long lines? (or both?)

@zkat
Copy link
Owner Author

zkat commented Jan 11, 2024

It's trimming horizontally, finding a "display window".

For example, if you have 10,000 chars of JSON on a single line, and the syntax error is on char 5,000, then it would only render the syntax error range, plus a certain number of characters before and after, possibly with ellipses.

@Benjamin-L
Copy link
Contributor

The case that came up in #327 is slightly trickier, but still probably covered by this issue. It's like a 10,000 char JSON file where there's one label at char 10 and one at char 90,000. There are two ways I can think of to display that: splitting it into two separate snippets or putting it in one snippet that's broken in the middle.

Error: gen_completions::deser::kdl::duplicate_flag (link)

  × Error encountered while deserializing
  ╰─▶ Error encountered while reading command information
   ╭─[test.kdl:2:1]
 2 │     flags {
 3 │  ··· aaaaaaaaaaaaaa" "-h" {
   ·                      ──┬─
   ·                        ╰── duplicate flag
 4 │             desc "foo bar baz"
   ╰────
   ╭─[test.kdl:2:1]
 2 │     flags {
 3 │         "-h" "--very long string ···
   ·         ──┬─
   ·           ╰── already given here
 4 │             desc "foo bar baz"
   ╰────

versus

Error: gen_completions::deser::kdl::duplicate_flag (link)

  × Error encountered while deserializing
  ╰─▶ Error encountered while reading command information
   ╭─[test.kdl:2:1]
 2 │     flags {
 3 │         "-h" "--very long string ··· aaaaaa" "-h" {
   ·         ──┬─                                 ──┬─
   ·           │                                    ╰── duplicate flag
   ·           ╰── already given here
 4 │             desc "foo bar baz"
   ╰────

The first option is likely easier to implement, and more consistent with how vertical trimming currently works.

@zkat
Copy link
Owner Author

zkat commented Jan 11, 2024

splitting it into two definitely seems like the most readable alternative, yeh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest Stuff that's good for hacktoberfest contribs help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants