-
-
Notifications
You must be signed in to change notification settings - Fork 389
Eyesores caused by overlapping warnings/errors #1583
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
Comments
This is a bad interaction between diagnostics from several sources, so maybe the right solution could be fix for all cases in hls-plugin-api itself. |
The reason I am against your suggested fix (which is also the first thought that came to my mind) is because of reading some discussion regarding the error refactoring currently occurring in GHC. During that discussion, Richard Eisenberg brought up a good point that many warning are actually very helpful and even important in terms of debugging. The unused variable warnings is a good example or better yet name shadowing (which is a very frustrating class of debuggable for beginners). I wonder whether HLint could help the issue by two levels of diagnostics:
so that we still get important warnings (such as unused variable or shadowed names) but omit refactoring suggestions. My point is that not showing warnings at all isn't good enough imo and, while better, omits a big gain to be had from warnings. |
Well, warnings will be shown after errors are fixed for sure. And you cant show properly both at same time in a clear way so the idea would be show them progressively in order of relevance: errors -> warnings -> suggestions. |
I think the is also arguably the client's responsibility to decide how to show these. |
Mmm, wise note as usual, yeah, the client should be able to filter diagnostics by type, does not vscode do it already? |
VSCode does this already, I routinely turn off info diagnostics while fixing errors |
Related reading: |
can we close this? |
Your environment
hls-1.0.0 on ubuntu (irrelevant afaik)
Which lsp-client do you use:
VS Code
Steps to reproduce
Code that causes the issue:
When writing code that produces an error, hlint warnings are still returned along with the error. This makes it very hard to find errors and generally clutters the developer workspace. When an error is encountered, the common case is to focus on the error and not to apply linter hints, which are commonly applied after the code in question compiles.
Suggestion: filter out hlint warnings that intersect with the text span of an error.
Perhaps this isn't really possible, but for examples such as the image above, the issue is extremely pronounced and produces really bad eyesores quite commonly.
Note: some warnings, such as unused variables are useful during uncompiling code, but many of these will not intersect with errors, and many of those warnings that are useful will be redundant since only intersecting warnings are filtered.
The text was updated successfully, but these errors were encountered: