3 ms·
I hate using ^ to indicate an offending position on a line. For those unfamiliar, the idea is that you display two lines, the erroneous one, and one full of spa
by miki123211 7y ago
I hate using ^ to indicate an offending position on a line. For those unfamiliar, the idea is that you display two lines, the erroneous one, and one full of spaces, with a single ^ in it, where the ^ is directly underneath the offending character. This is bad for accessibility and screen readers. They read that the ^ is here, but actually finding out what the wrong character is is problematic. Python does this, I think Rust too, and now Elm. Just provide a column number next to the line number, just like Golang does. Any decent editor will let me check what column I'm on. The ^ can, of course, be kept for the rest, but the column number would be a welcome addition.
- DougBTX 7y agoI can’t speak for the others, but at least in Rust the column number is at the end of the first line of the error, in format file.rs:line:column, eg main.rs:5:10 There are a few example errors here: https://github.com/rust-lang/rust/issues/36611 https://github.com/rust-lang/rust/issues/36611 Are the annotated code snippets after the first line useless with screen readers? I wonder if there’s a flag to hide just the snippets.
- steveklabnik 7y agoThere is a flag to hide the snippets and give a more compact output; you can also get it in JSON, I believe.
- miki123211 7y agoseems I was mistaken, Rust seems fine. I was probably misremembering, as I haven't played much with it. The point about Python and other still stands, though.
- razze 7y agoYou can get these infos from the json the compiler provides you on errors, that's also what all editors will use to show you errors, so they are aware where the error acually is.