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

Add display line offset #124

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Conversation

tertsdiepraam
Copy link
Contributor

@tertsdiepraam tertsdiepraam commented Aug 5, 2024

This is an alternative to #7 and also closes #6. I think this implementation is a bit simpler and hopefully easier to review.

To reiterate the use case. I have code like this:

#[test]
fn some_test() {
    parse_with_ariadne_errors("
       <some custom programming language here>
    ")
}

Now if ariadne prints an error for that test, I want it to give me the line number 3, not 1, because I want to know where the error is in the file, not in the string. I then automatically add the line number with a macro. I hope that makes sense. This has been super helpful for me :)

If the other implementation is preferred I could also adopt that PR and fix it up based on the feedback there.

@zesterer
Copy link
Owner

zesterer commented Aug 5, 2024

This seems like a useful change, thanks!

@zesterer
Copy link
Owner

zesterer commented Aug 5, 2024

Looks like it needs a cargo fmt before merging

@tertsdiepraam
Copy link
Contributor Author

Oops! Should be fixed now!

@zesterer zesterer merged commit 4e5987c into zesterer:main Aug 5, 2024
3 checks passed
@zesterer
Copy link
Owner

zesterer commented Aug 5, 2024

Thanks for the PR!

@tertsdiepraam
Copy link
Contributor Author

Thanks!

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

Successfully merging this pull request may close these issues.

Support for line offset
2 participants