rikvdkleij / intellij-haskell

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

[Feature] Added an intention that generates a type annotation for un-annotated functions #451

Closed dandoh closed 5 years ago

dandoh commented 5 years ago

Repeat #224. The latest intellj-elm has this feature, and I think it would be nice for intellj-haskell to have this too.

rikvdkleij commented 5 years ago

So you want support even when GHC does not give suggestions? So without -Wall

dandoh commented 5 years ago

No, just the normal one like GHC with -Wall, I think mostly people need it for top-level functions. The things is that there are lots of bad old codes without annotations for top-level functions, I have to Haskell.showType to find out their type and annotate them myself. So it would be useful to have the intention for this.

rikvdkleij commented 5 years ago

Hmm, when -Wall is enabled you should see the intentions to add type signatures to top-level functions.

dandoh commented 5 years ago

You mean if I do this, I'll see the intentions if the signature is missing?: image I tried but doesn't seem to work.

rikvdkleij commented 5 years ago

No, in your project's cabal file.

dandoh commented 5 years ago

Oh you're right. I added this to package.yaml and it works

library:
  source-dirs: src
  ghc-options:
    - -Wmissing-signatures

But do you think it should be the default behavior?