DanielG / ghc-mod

Happy Haskell Hacking for editors. DEPRECATED
Other
677 stars 175 forks source link

Passing "-v for more information" to ghc-mod boot doesn't provide more information #606

Open mineo opened 9 years ago

mineo commented 9 years ago

In #605 ghc-mod is telling me to (use -v for more information) but neither ghc-mod boot -v nor ghc-mod -v boot change the output. After reading ghc-mod --help I tried

↪ ghc-mod -v 7 boot ghc-mod: unknown command: `7'

which is not helpful.

DanielG commented 9 years ago

That's GHC telling you that so you need to use -g to pass it down to GHC and maybe -v6 to get ghc-mod to even print GHC's log messages.

mineo commented 9 years ago

That's not obvious at all from the output:

ghc-mod: <command line>: cannot satisfy -package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
   (use -v for more information)

To me the first line looks like a message from ghc-mod and the indentation of the second line suggests it's a continuation of the first line.

DanielG commented 9 years ago

indeed, but we can't really catch all possible ghc error messages and fixup references to options so suggest something sensible and we can consider it ;)

mineo commented 9 years ago

I have no idea how ghc-mod works internally but if you're calling ghc as an external process, why not add something like "the following messages are from GHC" in front of every call/captured stderr?

DanielG commented 9 years ago

We're not calling ghc as a process so it's not that easy :p

DanielG commented 9 years ago

An easy solution might be to tie ghc-mod's -v option to ghc's so if you do -v at the top level we'll pass that down to ghc. Only problem with that is mapping the loglevels since ghc-mod has more than ghc does so we can't just do a 1-1 mapping and everything else would be even more confusing.

mineo commented 9 years ago

We're not calling ghc as a process so it's not that easy :p

Hm, so you're not calling ghc as a process but it's still printing messages about command line flags? That doesn't sound like sensible behaviour.