Open jneira opened 3 years ago
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 -Wall
default for a single file? For example, I create a temp dir and a hs file named A.hs
, I think it's better to open warning default in this condition. It has great advantages to beginners but little confuses.
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. or should there be a knowledge that we take as granted from the user?
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.
Shall we enable
-Wall
default for a single file?
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: https://github.com/haskell/cabal/issues/5696#issuecomment-692659025.)
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
https://github.com/haskell/haskell-language-server/blob/2fef04193cfe2ac08372a008a5b5cfb6275d5bea/ghcide/src/Development/IDE/Plugin/CodeAction.hs#L322