rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

wrong redundant import removed (beta64) #527

Closed aryairani closed 4 years ago

aryairani commented 4 years ago

For this example, I have a redundant imported symbol, per ghcid's output:

image

intellij-idea shows the same redundant import image

and the following action: image

but when executed, line 23 was removed (the qualified import), not line 24: image

which is not what we wanted: image

rikvdkleij commented 4 years ago

Thanks for reporting!

rikvdkleij commented 4 years ago

Should be fixed in beta65.

rikvdkleij commented 4 years ago

@aryairani Can this one be closed?

aryairani commented 4 years ago

I think so. I did a lot of "Remove redundant import"s in beta66 yesterday (as you may have guessed), and didn't encounter this issue.

aryairani commented 4 years ago

Hmm, I tried to test out the original scenario after updating to beta68, but actually not seeing the warnings inline at all now. Should I open a separate ticket, or something else I can try? I already deleted and recreated the project.

image

rikvdkleij commented 4 years ago

The warnings are not there because of the compile error. The inline warnings are derived from GHC warnings.

aryairani commented 4 years ago

We have -Werror enabled in stack.yaml, so warnings end up as GHC errors, but this hasn't changed recently, and they are still just warnings in GHCi. So but unless something changed between beta64 and beta68 with respect to how errors & warnings are handled, I wonder if there's a different explanation?

rikvdkleij commented 4 years ago

Okay, I have enabled -Wall and -Werror and it works for me.

Maybe it's the case that file is not yet loaded in the REPL, that happens sometimes when the project is opened and IntelliJ wants to show annotations for the file but the REPL is not yet ready. I have created a solution for that but doesn't work in all cases. So then e.g. you just have to press an enter to load the file in the REPL and see the annotations.

rikvdkleij commented 4 years ago

Maybe it's the case that file is not yet loaded in the REPL, that happens sometimes when the project is opened and IntelliJ wants to show annotations for the file but the REPL is not yet ready. I have created a solution for that but doesn't work in all cases. So then e.g. you just have to press an enter to load the file in the REPL and see the annotations

I found an issue related to this, could be your issue.

rikvdkleij commented 4 years ago

@aryairani Can you confirm that changing the file e.g. by just pressing an enter, shows the warnings.

If that's is the case then I know your issue and that is an non-deterministic issue for already long time. I'm investigating the right solution for this issue.