diff options
author | Ryan Cumming <[email protected]> | 2019-06-24 22:40:06 +0100 |
---|---|---|
committer | Ryan Cumming <[email protected]> | 2019-06-25 12:16:04 +0100 |
commit | 6d6cb25cf46a2327d6cb2278385763abfa7a95a0 (patch) | |
tree | 334f256dd02766fd4103abc485ff62918a27e6f9 /docs/dev/guide.md | |
parent | 364ac9b9468e1930f39e0dddc454b2eb7d68f360 (diff) |
Rich mapping of cargo watch output
Currently we depend on the ASCII rendering string that `rustc` provides
to populate Visual Studio Code's diagnostic. This has a number of
shortcomings:
1. It's not a very good use of space in the error list
2. We can't jump to secondary spans (e.g. where a called function is
defined)
3. We can't use Code Actions aka Quick Fix
This moves all of the low-level parsing and mapping to a
`rust_diagnostics.ts`. This uses some heuristics to map Rust diagnostics
to VsCode:
1. As before, the Rust diagnostic message and primary span is used for
the root diagnostic. However, we now just use the message instead of
the rendered version.
2. Every secondary span is converted to "related information". This
shows as child in the error list and can be jumped to.
3. Every child diagnostic is categorised in to three buckets:
1. If they have no span they're treated as another line of the root
messages
2. If they have replacement text they're treated as a Code Action
3. If they have a span but no replacement text they're treated as
related information (same as secondary spans).
Diffstat (limited to 'docs/dev/guide.md')
0 files changed, 0 insertions, 0 deletions