feat(lsp): configurable diagnostic severity - #1325
Merged
Merged
Conversation
matoous
commented
Dec 21, 2021
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
archseer
reviewed
Dec 21, 2021
matoous
commented
Dec 21, 2021
| | 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`) | |
Contributor
Author
There was a problem hiding this comment.
This is the new entry, the rest is just formatting
Member
There was a problem hiding this comment.
diagnostic-severity, we remap the name to kebab-case via serde
Contributor
Author
There was a problem hiding this comment.
sorry, forgot, fixed now
dead10ck
approved these changes
Dec 22, 2021
| DiagnosticSeverity::WARNING => Warning, | ||
| DiagnosticSeverity::INFORMATION => Info, | ||
| DiagnosticSeverity::HINT => Hint, | ||
| severity => unimplemented!("{:?}", severity), |
Member
There was a problem hiding this comment.
Should this just return None? Or if this isn't likely to change, maybe unreachable!?
Contributor
Author
There was a problem hiding this comment.
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.
Member
|
@matoous seems like an implementation of |
Contributor
Author
|
@sudormrfbin yes, sorry 🙈 fixed now |
Member
|
Thanks! Looks good now 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow severity of diagnostic messages to be configured.
E.g. allow turning of Hint level diagnostics.
Fixes: #1007