-
-
Notifications
You must be signed in to change notification settings - Fork 389
Document what ghc warnings are needed for each ghcide feature (f.e. -Wredundant-imports
for remove unused imports)
#2064
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
It's not just redundant imports. In general, warnings need to be turned on in order to get ghcide code actions to address them, as ghcide will not turn any warnings on for you other than missing signatures, for type lenses |
Shall we enable |
Mmm i see, well, lets make this more generic then: it would be great a table or list of what warning is needed for each ghcide feature. |
-Wredundant-imports
is needed to trigger remove unused imports code actions-Wredundant-imports
for remove unused imports)
-Wredundant-imports
for remove unused imports) -Wredundant-imports
for remove unused imports)
I prefer hls is a partner for every new Haskell learner, we'd better assume users have no knowledge about hls itself, even no programming experience, so rely on these users to configure the project is a little difficult. import Data.List(nub)
import Data.List These redundant imports appear much more frequently in homework than in work I think. |
This might be a good idea. Or we could warn the user when they don't have it enabled, and prompt them to switch it on. (Alternatively, this could be mostly solved by Cabal: haskell/cabal#5696 (comment).) Anecdotally, this often catches out beginners. I've most recently seen evidence of this this week. But I'm sure the ones we see are the tip of the iceberg. |
I had an idea for how we could improve this from the GHC side: https://gitlab.haskell.org/ghc/ghc/-/issues/24329 |
haskell-language-server/ghcide/src/Development/IDE/Plugin/CodeAction.hs
Line 322 in 2fef041
The text was updated successfully, but these errors were encountered: