-
Notifications
You must be signed in to change notification settings - Fork 36.8k
Description
While working with languages like Rust with rich information in its errors, it's become apparent that not all of this information can be conveyed cleanly with the current Problems window. Take, for example, this error:
warning: this `if` has the same condition as a previous if, #[warn(ifs_same_cond)] on by default
--> src\main.rs:6:15
|
6 | } else if a == b {
| ^^^^^^
|
note: same as this
--> src\main.rs:4:8
|
4 | if a == b {
| ^^^^^^
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#ifs_same_condThe note referencing where the first condition was used would be helpful to the user, but we must omit it because the error list is sorted on the Range of the error, resulting in the note being sorted before the actual error:

While the above example doesn't look too ambiguous, when there are several errors spread out through the window, it quickly becomes extremely difficult to figure out what relates to each other.
If Diagnostic had a children: Diagnostic[] field where we could add additional context around the error, we would be able to convey more information to the user about the events that led to the error/warning.