Closed
Description
Often an error message has two parts - the heading and a label on a span. E.g.,
error[E0425]: cannot find value `labe` in this scope
--> src/actions/compiler_message_parsing.rs:116:30
|
116 | message.push_str(labe);
| ^^^^ did you mean `label`?
Here the heading is cannot find value
labe in this scope
and the label on the span is did you mean
label?
In this case the two contain different information.
However, in some cases, the info is duplicated, e.g.,
error[E0061]: this function takes 1 parameter but 0 parameters were supplied
--> src/actions/compiler_message_parsing.rs:116:21
|
116 | message.push_str();
| ^^^^^^^^ expected 1 parameter
This is a problem for IDEs because all errors are on spans and we must choose to either show both pieces of text (which looks weird and redundant in the second example) or just the heading (which elides information in the first example).
Alternatively, we could add some flag to the JSON error structure to indicate whether a label is redundant or not.