Skip to content

feat(lsp): configurable diagnostic severity - #1325

Merged
archseer merged 5 commits into
helix-editor:masterfrom
matoous:md/filter-diagnostics
Dec 25, 2021
Merged

feat(lsp): configurable diagnostic severity#1325
archseer merged 5 commits into
helix-editor:masterfrom
matoous:md/filter-diagnostics

Conversation

@matoous

@matoous matoous commented Dec 21, 2021

Copy link
Copy Markdown
Contributor

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

Fixes: #1007

Comment thread helix-view/src/document.rs Outdated
@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
Comment thread helix-core/src/syntax.rs
Comment thread 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`) |

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@dead10ck dead10ck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Comment thread helix-term/src/application.rs Outdated
DiagnosticSeverity::WARNING => Warning,
DiagnosticSeverity::INFORMATION => Info,
DiagnosticSeverity::HINT => Hint,
severity => unimplemented!("{:?}", severity),

Copy link
Copy Markdown
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
Copy Markdown
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.

@sudormrfbin sudormrfbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM !

@sudormrfbin

Copy link
Copy Markdown
Member

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

@matoous

matoous commented Dec 22, 2021

Copy link
Copy Markdown
Contributor Author

@sudormrfbin yes, sorry 🙈 fixed now

@archseer

Copy link
Copy Markdown
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