-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
Warnings emitted by the desugarer are not shown #1083
Comments
These warnings are generated by the desugarer. We only run as far as the type checker. We could go onwards, and have the code to do so, but it costs more CPU time. Should probably be added as a low priority rule and discard the output (to save memory). |
IIRC GHC shows these warnings even if you pass |
So currently there is no workaround to make ghcide to emit those warnings? |
Does this mean that no warnings work? Currently using |
@emlautarom1 no, not by a very long way, 90%+ of warnings show up, just those about pattern matches. If you are seeing no warnings, its not because of this issue. |
@ndmitchell Then please, take a look at #934 since I'm getting no warnings when using |
@maralorn do you continue missing those warnings? |
@jneira On
yes.
This file shows a warning when compiled, but is clean in the editor. |
(Which is an especially important warning in my opinion. For example this ghc proposal wants to make incompleteness an error via an extension.) |
@maralorn thanks for confirming that, i am not sure if this would be a feature request or a bug fix so both 😉 |
@maralorn I am afraid |
It's not about types, its that these warnings are emitted during desugaring - we have the types available. If we could generate these warnings without doing a full desugar that would definitely be preferable. If not, desugaring is just a time/memory cost, with the benefit of getting these warnings. |
@Ericson2314 I didn‘t put any hopes in the proposal for fixing this issue. I just mentioned it to underline the importance of a fix. If anything the proposal would probably make this issue slightly worse since one could argue that a false negative on an error is worse than on a warning. |
One option is to desugar only on open/save, so that we don't take the performance hit on every keystroke. |
Would be possible to do the desugaring async? So that typechecker errors can be shown before the desugaring is finished? |
@maralorn - the architecture of ghcide is such that if you write it, its almost certainly going to be async. Doing it on open/save is one option, but to be fair, we haven't actually measured performance. That's worth doing before we try and decide if it needs optimising. I don't actually think it's all that hard to do. Approximately:
As a result, I'm marking it beginner suitable bug. I personally find the desugarer warnings mostly useless, which is why I never prioritised it way back when, but I appreciate I'm an outlier here! |
I sometimes have some enabled warnings which don‘t get displayed even if all other warnings are and there are no errors in the code. A cabal run on the same file shows the warning. My feeling is it depends on the category of the warning. I noticed the problem with following categories:
all-missed-specialisations
incomplete-patterns
There might be more. I’d like to know if this warnings work for anybody else.
The text was updated successfully, but these errors were encountered: