-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Don't suggest -Wno-deferred-out-of-scope-variables
as a possible action.
#4440
Comments
Hi, thank you for your bug report! Does emacs run the code action for a particular location when there is only one code action? That feels like rather bad behaviour to me. It can easily happen that the only available code action is not something you want to execute, imo. Are you sure that's emacs behviour? Why do you need to restart HLS to undo the code action? Shouldn't |
Doom Emacs, at least, yes. It is... questionable UX, I agree. If it is not a constructor, like 'func = doesn'tExist', then I get 3 actions I can choose:
I know it should be an error there, but there is none reported by HLS (it got deferred by the flag and I didn't notice). So I try to get it back. Imagine copy-pasting some code, running add import on a bunch of variables and this guy gets inserted along the way, on the top of the file. I spend some time figuring it out, twice now. But ignoring Emacs behavior, let me elaborate. Is |
Related issue #2032, seems like we have some prior art of special casing some warnings. See PR #2061 for the fix. Fixes welcome! Either way, I think doom emacs's behaviour is broken, too. |
Seeing that PR I think you already did 90% of the work by just finding it! I'll then do my part and nuke that thing. As for Emacs, well, it's Emacs, can be configured, probably. |
Fixes haskell#4440 Fixes test for disabling deferred-type-errors.
Could HLS set |
Fixes haskell#4440 Fixes test for disabling deferred-type-errors.
Fixes haskell#4440 Fixes test for disabling deferred-type-errors.
Is your enhancement request related to a problem? Please describe.
With code
when I execute code action on
Doesn'tExist
, HLS (haskell-language-server version: 2.9.0.0 (GHC: 9.6.6)) adds{-# OPTIONS_GHC -Wno-deferred-out-of-scope-variables #-}
on the top of my file. It does this, I believe, because this is the only code action available. I don't think this is the solution that user wants in most cases. At least in Emacs it is easy to miss that HLS did that (if only one action is available, it is executed), leading to confusion on as to why, suddenly, HLS "doesn't work". It works, of course, because with that flag there is no longer a compile time error.Describe the solution you'd like
Don't suggest
{-# OPTIONS_GHC -Wno-deferred-out-of-scope-variables #-}
.Describe alternatives you've considered
Restarting HLS... a lot :) I don't think there is an alternative.
The text was updated successfully, but these errors were encountered: