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(lsp): configurable diagnostic severity #1325

Merged
merged 5 commits into from
Dec 25, 2021
Merged

feat(lsp): configurable diagnostic severity #1325

merged 5 commits into from
Dec 25, 2021

Conversation

matoous
Copy link
Contributor

@matoous matoous commented Dec 21, 2021

Allow severity of diagnostic messages to be configured.
E.g. allow turning of Hint level diagnostics.

Fixes: #1007

helix-view/src/document.rs Outdated Show resolved Hide resolved
@matoous matoous marked this pull request as ready for review December 21, 2021 12:49
Allow severity of diagnostic messages to be configured.
E.g. allow turning of Hint level diagnostics.

Fixes: #1007
| 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`) |
Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, forgot, fixed now

Copy link
Member

@dead10ck dead10ck left a comment

Choose a reason for hiding this comment

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

Thanks!

DiagnosticSeverity::WARNING => Warning,
DiagnosticSeverity::INFORMATION => Info,
DiagnosticSeverity::HINT => Hint,
severity => unimplemented!("{:?}", severity),
Copy link
Member

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!?

Copy link
Contributor Author

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.

Copy link
Member

@sudormrfbin sudormrfbin left a comment

Choose a reason for hiding this comment

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

LGTM !

@sudormrfbin
Copy link
Member

@matoous seems like an implementation of shrink_selection crept through in the latest commit :P

@matoous
Copy link
Contributor Author

matoous commented Dec 22, 2021

@sudormrfbin yes, sorry 🙈 fixed now

@archseer
Copy link
Member

Thanks! Looks good now 👍

@archseer archseer merged commit 0e7d757 into helix-editor:master Dec 25, 2021
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.

Filter diagnostics lint level in languages.toml
4 participants