I'm experimenting with diagnostics formatting.
* I've added a left margin, showing both the file name and line numbers
* I'm showing one line of context above/below the offending line.
* I'm using grey for comments.
What do you think? Is there anything you'd change?
Related Posts
Further tinkering with diagnostics, following feedback!
* Two lines of context above and below now.
* The caret is included in the line below where possible.
* Syntax highlighting of keywords.
I kinda feel that smart context sizing would be better. What do you think so far?
In LSP, a position is represented as a line number and a column offset (in Unicode code units): https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position
This is pretty elegant. You'll get the correct line regardless of encoding bugs, and the editor already knows the line number so it's cheap to compute.
Chekhov's repro: If a line of code is included in a bug report, it should contribute to the debugging somewhere.