Open L7R7 opened 4 years ago
Thanks for reporting!
Would be helpful to have more cases which go wrong.
Ok, I'll try to collect more cases
the quick fix doesn't change anything here (it suggests (show . f)
, I would expect another fix after that that results in the same as above)
sample :: [Int] -> (Int -> Int) -> [String]
sample xs f = ((show . f)) <$> xs
blabla = (\header -> (fst header) == privateToken)
removing the outer brackets work. Removing the brackets around fst header
doesn't:
blabla = \ header -> fst header == privateToken == privateToken
Investigated this issue and to solve this properly I have to change the integration with HLint. Will take some effort but it's necessary.
Should be fixed in beta85, https://github.com/rikvdkleij/intellij-haskell/releases/tag/v1.0.0-beta85
@L7R7 Are your HLint issues solved?
I totally missed the notifications on this issue, sorry for letting you wait! I just downloaded beta85 and tried it. I can tell that it definitely got better. The fixes for my first examples work now (the sample
function ones). However, the last one is still a bit weird. For this one:
blabla = (\header -> (fst header) == "privateToken")
I get three suggestions (two redundant brackets and one redundant lambda). The fixes for brackets work, but when I apply the fix for the redundant lambda I get:
blheaderblheader header = (fst heheaderder) == "privheaderteToken"
Interestingly, the suggestion in the popup is weird already:
I get the same behavior even when I apply the fixes for the brackets first
Thanks! Will take a look to this case soon.
Since the latest beta (?) applying hlint suggestions doesn't always work. There are some cases where it does work, and others where the suggestion is inserted without overriding existing code. Here's a sample:
IntelliJ offers me a quick fix saying:
when I apply the fix, I end up with the following:
So, it doesn't override
<$> xs
but inserts it (similar to when I press Enter instead of Tab for completion).My guess is that it is related to when there are a function composition operator and redundant brackets involved, but I'm not sure about that.
I'm on plugin version 1.0.0-beta78, IntellIJ IDEA 2020.2.1 RC (Ultimate Edition) Build #IU-202.6948.36 (I faced the issue with 2020.2 as well)