diff options
author | Michael Davis | 2022-10-11 06:46:47 +0000 |
---|---|---|
committer | GitHub | 2022-10-11 06:46:47 +0000 |
commit | 65febe0cf40807b446722fb402c1cfa6c983299a (patch) | |
tree | 7b5c818810c9d24909156d6f0ac4389326eda00d /xtask/src/path.rs | |
parent | 1a87cbd5082f410aee362a274edcc817bfb9f34a (diff) |
Overlay all diagnostics with highest severity on top (#4113)
Here we separate the diagnostics by severity and then overlay the Vec
of spans for each severity on top of the highlights. The error
diagnostics end up overlaid on the warning diagnostics, which are
overlaid on the hints, overlaid on info, overlaid on any other severity
(default), then overlaid on the syntax highlights.
This fixes two things:
* Error diagnostics are now always visible when overlapped with other
diagnostics.
* Ghost text is eliminated.
* Ghost text was caused by duplicate diagnostics at the EOF:
overlaps within the merged `Vec<(usize, Range<usize>)>` violate
assumptions in `helix_core::syntax::Merge`.
* When we push a new range, we check it against the last range and
merge the two if they overlap. This is safe because they both
have the same severity and therefore highlight.
The actual merge is skipped for any of these when they are empty, so
this is very fast in practice. For some data, I threw together an FPS
counter which renders as fast as possible and logs the renders per
second.
With no diagnostics, I see an FPS gain from this change from 868 FPS
to 878 (+1.1%) on a release build on a Rust file. On an Erlang file
with 12 error diagnostics and 6 warnings in view (233 errors and 66
warnings total), I see a decrease in average FPS from 795 to 790
(-0.6%) on a release build.
Diffstat (limited to 'xtask/src/path.rs')
0 files changed, 0 insertions, 0 deletions