Giter VIP home page Giter VIP logo

Comments (5)

Benjamin-L avatar Benjamin-L commented on August 25, 2024 2

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.

from miette.

zkat avatar zkat commented on August 25, 2024 1

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.

from miette.

jdonszelmann avatar jdonszelmann commented on August 25, 2024

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

from miette.

ysthakur avatar ysthakur commented on August 25, 2024

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?)

from miette.

zkat avatar zkat commented on August 25, 2024

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

from miette.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.