-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
refactor(statusline): add hint and info for non-workspace diagnostics #13257
Conversation
55a106f
to
84ff850
Compare
84ff850
to
c1cbf44
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC it's only warnings and errors now so that the component doesn't take up much space. Adding hints + info makes it fairly wide
Some(Severity::Hint) | None => counts.0 += 1, | ||
Some(Severity::Info) => counts.1 += 1, | ||
Some(Severity::Warning) => counts.2 += 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent we should probably use diag.severity()
here so that None
becomes Warning
-
helix/helix-core/src/diagnostic.rs
Lines 97 to 102 in efdcf34
impl Diagnostic { | |
#[inline] | |
pub fn severity(&self) -> Severity { | |
self.severity.unwrap_or(Severity::Warning) | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason Warning was chosen and not something else like Hint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of the context of it. It does make some sense to me that the "default" state of a diagnostic is a warning. I don't think it's very common that language servers omit the severity anyways
I wonder if there would be a nice way to have a min severity like how inline diagnostics have? The default would be to keep warning. But then you can change to "hint" or "info" (or even just "error"). [editor.statusline]
min-diagnostic-severity = "hint" |
Superseded by #13288 |
This adds info and hint diagnostics indicators to the existing warning and error. Besides having more info for the current code you are looking at, this also opens up changing the fallback accumulator being to hint now, instead of error. In cases where LSPs improperly handle diagnostic level declaration, this now prevents an error being declared across both the current buffer as well as the workspace (I have removed the fallback accumulator for the workspace). This should hopefully help reduce noise.