-
-
Notifications
You must be signed in to change notification settings - Fork 327
Include the end column in validation errors #753
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
Comments
We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo. |
@pimterry can you please consider explaining it with an example? Do you mean the whole tag or word or something else? |
Hi @amitguptagwl. It probably depends on the context and the specific error. As one example though, given: <root>hello</wrong> Validation returns:
Col 12 just points to the Similarly it would be helpful to get the start & end of a bad attribute, etc. In most cases I imagine the range will be known already (e.g. in the above case, you have parsed to the end of the tag to get the name anyway) but it's just a matter of extracting & exposing that information. |
got you. let me think how and what to implement here. This will take some time. |
It would be super useful to be able to get a column range from a validation error, not just the start column that's currently included. We're looking at using fast-xml-parser for validation in the HTTP Toolkit UI to show inline XML errors, and it would be great to be able to put the red squiggly line in the right place.
Right now, the only real option I think is to show the whole line as an error (which is what https://naturalintelligence.github.io/fast-xml-parser/ does - but this isn't great if your XML isn't prettified since it just highlights the whole document) or show just a single character error on the exact column (technically correct, but ugly and hard to spot, so not great UX).
I understand that won't always be available, so we probably have to fall back to marking the whole line, but I think there's quite a few cases where it should be easy to calculate, and even just having it in a few obvious cases would very useful.
The text was updated successfully, but these errors were encountered: