You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clang-style diagnostics: show the failing source with the span underlined #657
Diagnostics today are one line: file.kex:2:3: error: Type mismatch: expected Integer, got String, in color or not. The reader has to open the file to see what it refers to.
Proposal: show the failing source under the message, with the span underlined, as clang (and rustc, Elm) do:
file.kex:2:20: Error [KEXET-0042]: Type mismatch: expected Integer, got String
|
2 | let x: Integer = "a"
| ------- ^^^ this is a String
| |
| expected because of this annotation
The primary span underlined with ^, secondary spans (the annotation, the declaration a call resolved to) with - and a short label each.
Notes that already exist (note: triggered by tagged literal …) get their own snippet.
Off with --no-snippets, and in --json (which carries the spans as data instead); on by default on a terminal.
Colors follow --no-colors as today.
Needs: every diagnostic to carry a span (start and end), not only a start position; several secondary locations for the messages that name one (an expected type's annotation, an overload's declaration). Pairs with stable error codes (#656).
Activity
Show a diagnostic's source with its span underlined