rust/editors/code
Ryan Cumming 8f726b7db6 Include primary span label in VS Code diagnostics
In most cases the primary label span repeats information found elsewhere
in the diagnostic. For example, with E0061:

```
{
  "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.:

```
{
  "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.
2019-06-30 11:12:56 +10:00
..
.vscode Initial Visual Studio Code unit tests 2019-06-26 20:31:36 +10:00
src Include primary span label in VS Code diagnostics 2019-06-30 11:12:56 +10: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