helix icon indicating copy to clipboard operation
helix copied to clipboard

Add a workspace diagnostics indicator to the status line

Open dariooddenino opened this issue 3 years ago • 2 comments

Status lines have yellow/red icons with numbers to indicate how many warning/errors are present in the current buffer.

I think it would be useful to display the workspace total too there to get a quick visual feedback instead of having to manually input <space>-D to open the workspace diagnostics picker.

Some ideas:

  1. Use a number format like 1/13, meaning that the current buffer has 1 warning/error and the workspace has 13 in total.
  2. Use two completely different sets of numbers/icons for buffer diagnostics and workspace diagnostics.
  3. Add a workspace status line at the bottom that spans the whole application window width and which could hold more general information (like workspace diagnostics).

dariooddenino avatar Oct 31 '22 13:10 dariooddenino

I was giving a quick look at this, and I have it down more or less but I'm confused by something.

We have both lsp::DiagnosticSeverity, which is what's stored in context.editor.diagnostics and helix_core::diagnostic::Severity returned by context.doc.diagnostics().

Is there a reason for having two different data structures (that apparently have the same purpose) returned by two similar functions?

dariooddenino avatar Nov 02 '22 16:11 dariooddenino

lsp::DiagnosticSeverity is from the lsp_types crate https://docs.rs/lsp-types/latest/lsp_types/struct.DiagnosticSeverity.html while helix_core::diagnostic::Severity is custom. The lsp_types one is a struct with constants while the custom one is an Enum

the-mikedavis avatar Nov 02 '22 16:11 the-mikedavis