rust/editors/code
bors[bot] fb2534f300 Merge #1459
1459: Include primary span label in VS Code diagnostics r=matklad a=etaoins

In most cases the primary label span repeats information found elsewhere in the diagnostic. For example, with E0061:

```json
{
  "message": "this function takes 2 parameters but 3 parameters were supplied",
  "spans": [{"label": "expected 2 parameters"}]
}
```

However, with some mismatched type errors (E0308) the expected type only appears in the primary span's label, e.g.:

```json
{
  "message": "mismatched types",
  "spans": [{"label": "expected usize, found u32"}]
}
```

I initially added the primary span label to the message unconditionally. However, for most error types the child diagnostics repeat the primary span label with more detail. `rustc` also renders the duplicate text but because the span label and child diagnostics appear in visually distinct places it's not as confusing.

This takes a heuristic approach where it will only add the primary span label if there are no child message lines. For most error types the child messages repeat the primary span label with more detail.

Co-authored-by: Ryan Cumming <etaoins@gmail.com>
2019-06-30 09:54:47 +00:00
..
.vscode Initial Visual Studio Code unit tests 2019-06-26 20:31:36 +10:00
src Merge #1459 2019-06-30 09:54:47 +00:00
.gitignore rename all things 2018-09-16 13:07:39 +03:00
.vscodeignore rename all things 2018-09-16 13:07:39 +03:00
package-lock.json Semantic highlighting spike 2019-05-27 11:26:33 +02:00
package.json Initial Visual Studio Code unit tests 2019-06-26 20:31:36 +10:00
tsconfig.json Add noUnusedLocals to VsCode tsconfig 2019-06-29 18:00:22 +10:00
tslint.json Run prettier on all files 2018-10-08 22:38:33 +01:00