Skip to content

Conversation

@pimterry
Copy link
Contributor

If you're parsing JSON and providing feedback about errors to a user or developer, a specific line & character is more useful than an offset.

JSONVisitor onError already exposes this information, but parse() and parseTree() did not. This tiny change just exposes the existing error details on all ParseErrors.

This fixes #1 (already closed, but there's ongoing debate there about adding line & character information).

@aeschli
Copy link
Contributor

aeschli commented Aug 5, 2025

Thanks @pimterry !

@aeschli aeschli enabled auto-merge (squash) August 5, 2025 08:53
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Aug 5, 2025
@aeschli aeschli merged commit fe33019 into microsoft:main Aug 5, 2025
2 checks passed
@pimterry pimterry deleted the error-lines branch August 5, 2025 10:17
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.

Error objects should also contain location information

3 participants