Skip to content

Include the end column in validation errors #753

@pimterry

Description

@pimterry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions