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 line number and column output to error #341

Open
1 task done
kehoecj opened this issue May 31, 2023 · 2 comments
Open
1 task done

Add line number and column output to error #341

kehoecj opened this issue May 31, 2023 · 2 comments
Labels
feature Categorizes as related to a new feature

Comments

@kehoecj
Copy link

kehoecj commented May 31, 2023

Describe the feature

It would be beneficial to users of this library to add line and column number to the error output to help users determine the source of the error. The current implementation only displays the text output of the line where the error ocurred.

Describe the solution you'd like

Line and Column output in the error output

Describe alternatives you've considered

I attempted to calculate it by utilizing the parse function directly but it was not possible

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kehoecj
Copy link
Author

kehoecj commented Jun 1, 2023

@unknwon I'd like to take a shot at implementing this unless you have any concerns. Would you prefer the error to automatically include the line/column in the message, a solution like JSON Offset, or something else?

@unknwon
Copy link
Member

unknwon commented Jun 1, 2023

@unknwon I'd like to take a shot at implementing this unless you have any concerns. Would you prefer the error to automatically include the line/column in the message, a solution like JSON Offset, or something else?

Hey @kehoecj, thanks for your interests!

Ideally, the error message should have the line and column (both 1-based) of the position. Personally, I find it very hard to use offset because that means I can't just open the editor to fix the file, and always have to counting from the beginning of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Categorizes as related to a new feature
Projects
None yet
Development

No branches or pull requests

2 participants