feat(lsp): show hints from deno_lint
in addition to messages
#10739
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.
Currently, the LSP returns only messages from
deno_lint
; hints are omitted even when they are.Some lint rules are very unfriendly in the sense that their diagnostic messages give no information about how the lint errors should be addressed properly without having to suppress them.
One example is
ban-ts-comment
rule, as its message just tells that the directive is disallowed without comment - when seeing this, one may wonder what "comment" is. While the message is very unclear, the hint is so informative that it gives a concrete example of how to address it, likeAdd an in-line comment explaining the reason for using `@ts-expect-error`, like `// @ts-expect-error: <reason>
Therefore, it would be very nice to show not only messages but also hints from
deno_lint
. This PR appends hints to messages if any.before
![without_hint](https://user-images.githubusercontent.com/23649474/119167207-8b50f280-ba9a-11eb-86b6-f325e0b73a0f.png)
after
![with_hint](https://user-images.githubusercontent.com/23649474/119167201-8a1fc580-ba9a-11eb-84ea-e85f1d581312.png)