-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(lsp): configurable diagnostic severity #1325
Conversation
Allow severity of diagnostic messages to be configured. E.g. allow turning of Hint level diagnostics. Fixes: #1007
book/src/guides/adding_languages.md
Outdated
| shebangs | The interpreters from the shebang line, for example `["sh", "bash"]` | | ||
| roots | A set of marker files to look for when trying to find the workspace root. For example `Cargo.lock`, `yarn.lock` | | ||
| auto-format | Whether to autoformat this language when saving | | ||
| diagnostic_severity | Minimal severity of diagnostic for it to be displayed. (Allowed values: `Error`, `Warning`, `Info`, `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.
This is the new entry, the rest is just formatting
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.
diagnostic-severity
, we remap the name to kebab-case via serde
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.
sorry, forgot, fixed now
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.
Thanks!
helix-term/src/application.rs
Outdated
DiagnosticSeverity::WARNING => Warning, | ||
DiagnosticSeverity::INFORMATION => Info, | ||
DiagnosticSeverity::HINT => Hint, | ||
severity => unimplemented!("{:?}", severity), |
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.
Should this just return None
? Or if this isn't likely to change, maybe unreachable!
?
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 think this is not going to change (at least in foreseeable future). I changed the statement to unreachable!
, let me know if I should revert it.
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.
LGTM !
@matoous seems like an implementation of |
@sudormrfbin yes, sorry 🙈 fixed now |
Thanks! Looks good now 👍 |
Allow severity of diagnostic messages to be configured.
E.g. allow turning of Hint level diagnostics.
Fixes: #1007