miniblog.

← Back to all posts
53
I've been iterating further on how Garden shows type errors. For types in the standard library, I'm now showing "a String" but "an Int". I'm also doing basic syntax highlighting of the code excerpt. What do you think?

3 Comments

@wilfredh Looks good. Maybe skip the empty line after the error message, so that it is unambiguous to which listing it belongs. That would also cause a nice 1 paragraph per error.
@karlb Interesting, I've only just added the empty line after the message! I suppose it's less clear when there are multiple errors (like here), but I felt it was getting too dense without the whitespace. I should probably take a look at what others (e.g. clang, rustc, elm) do in this case.
@wilfredh @karlb I think others say "The thing at path/foo.txt:123:42", so the file path/lineno is in the message. With an excerpt carrying the same file path and line no again, that might feel repetitive. Perhaps omit empty line and file path from the excerpt head, but keep something short like `--| base-filename.txt` (no path or line no) as the "tab" / excerpt head, to visually connect the two blocks. Both unambiguous, and still feels as whitespace for most of that line?