helix
helix copied to clipboard
Add a workspace diagnostics indicator to the status line
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:
- Use a number format like
1/13, meaning that the current buffer has 1 warning/error and the workspace has 13 in total. - Use two completely different sets of numbers/icons for buffer diagnostics and workspace diagnostics.
- 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).
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?
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