helix/helix-term/src
Michael Davis 65febe0cf4
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.
2022-10-11 15:46:47 +09:00
..
commands Add a helper function for applying transactions 2022-10-11 12:17:32 +09:00
keymap Keep arrow and special keys in insert (#3915) 2022-10-04 00:08:15 +09:00
ui Overlay all diagnostics with highest severity on top (#4113) 2022-10-11 15:46:47 +09:00
application.rs Propagate idle timeout event to components (#3172) 2022-10-11 09:10:01 +09:00
args.rs Add command line parameter to specify log file (#3807) 2022-09-20 16:11:30 +09:00
commands.rs Add a helper function for applying transactions 2022-10-11 12:17:32 +09:00
compositor.rs Add bracketed paste (#3233) 2022-08-29 09:48:49 +09:00
config.rs Move top level lsp config to editor.lsp (#1868) 2022-03-28 10:11:52 +09:00
health.rs Show clipboard info in --health output (#2947) 2022-09-01 01:23:45 +09:00
job.rs fix(command): write-quit: do not quit if write fails 2022-06-18 23:57:47 -04:00
keymap.rs Improve keymap errors from command typos (#3931) 2022-09-22 09:30:42 +08:00
lib.rs Add refresh-config and open-config command (#1803) 2022-03-25 18:05:20 +09:00
main.rs Add command line parameter to specify log file (#3807) 2022-09-20 16:11:30 +09:00