Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): add [workspace-]diagnostics fields to statusline #13288

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RoloEdits
Copy link
Contributor

@RoloEdits RoloEdits commented Apr 7, 2025

Adds diagnostics and workspace-diagnostics fields to the statusline editor config. This allows you to define a list of severities that will then be rendered in the order of definition:

[editor.statusline]
diagnostics = ["error", "hint", "warning"]
workspace-diagnostics = ["warning", "hint", "error"]

image

This defaults to:

[editor.statusline]
diagnostics = ["warning", "error"]
workspace-diagnostics = ["warning", "error"]

the current master behavior.

Subsumes: #13256 and #13257

@nik-rev
Copy link
Contributor

nik-rev commented Apr 7, 2025

Instead, why not have 1 config option (instead of 3) to allow setting where the error, info, warn, and hint will be

# default
diagnostics = ["error", "warn", "info", "hint"]
# reversed
diagnostics = ["hint", "info", "warn", "error"]
# min severity = warn:
diagnostics = ["warn", "error"]

@RoloEdits RoloEdits force-pushed the statusline-diag-config branch from 5306f80 to 601fcb1 Compare April 7, 2025 04:21
@RoloEdits RoloEdits changed the title feat(config): add rev variant to diagnostics and a display min level feat(config): add diagnostics and w-diagnostics field to statusline Apr 7, 2025
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good way to allow configuring this to me 👍. Could you add the new options to the book?

helix/book/src/editor.md

Lines 110 to 118 in 9cfb8af

| Key | Description | Default |
| --- | --- | --- |
| `left` | A list of elements aligned to the left of the statusline | `["mode", "spinner", "file-name", "read-only-indicator", "file-modification-indicator"]` |
| `center` | A list of elements aligned to the middle of the statusline | `[]` |
| `right` | A list of elements aligned to the right of the statusline | `["diagnostics", "selections", "register", "position", "file-encoding"]` |
| `separator` | The character used to separate elements in the statusline | `"│"` |
| `mode.normal` | The text shown in the `mode` element for normal mode | `"NOR"` |
| `mode.insert` | The text shown in the `mode` element for insert mode | `"INS"` |
| `mode.select` | The text shown in the `mode` element for select mode | `"SEL"` |

@RoloEdits RoloEdits changed the title feat(config): add diagnostics and w-diagnostics field to statusline feat(config): add [diagnostics and w-diagnostics field to statusline Apr 7, 2025
@RoloEdits RoloEdits changed the title feat(config): add [diagnostics and w-diagnostics field to statusline feat(config): add [workspace-]diagnostics fields to statusline Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants