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

Zero length span #356

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Zero length span #356

wants to merge 6 commits into from

Commits on Mar 20, 2024

  1. Configuration menu
    Copy the full SHA
    6f8fbf8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a37328a View commit details
    Browse the repository at this point in the history
  3. fix(SourceCode): Fix and improve default SourceCode implementation

    - Fix a panic when a 0 length span covers the end of a document
    - Fix incorrect `line_count`
    - Add new unit tests and complete existing ones
    - Improve readability
    Nahor committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    f7fa50d View commit details
    Browse the repository at this point in the history
  4. fix(zero length, no context): Add Option to distinguish between "curr…

    …ent line" and "just the span"
    
    Fixes zkat#355
    
    Change the number of context lines from usize to Option<usize> to allow
    choosing between "just the span" (as implemented previously when using
    0 context line) using `None`, and displaying the error line without
    extra context (not possible before) using `Some(0)`.
    Nahor committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    d63b2bb View commit details
    Browse the repository at this point in the history
  5. fix(miri): remove or mark as dead_code unused internal structs

    - Mark as dead_code the structs uses in testing
    - Remove unused code inherited from Eyre for converting `Option` into
      `Result`
    Nahor committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    d0c1143 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2024

  1. fix(zero length): Improve rendering for zero-length error spans

    A zero-length span at a line boundary can be associated either with the
    previous or the next line. Current code prefer to use the next line,
    however there isn't always a "next line" (end of source, or "no context"
    configuration).
    There is also the extra-special case of an empty document which has no
    "next line" but also no "previous line".
    
    This commit adds an empty newline at the end of a document if appropriate
    so that there is a "next line", or use the "previous line"
    Nahor committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    c7cbb07 View commit details
    Browse the repository at this point in the history