vscode-ghc-mod
vscode-ghc-mod copied to clipboard
Not seeing extension output in VSCode
Hi there,
I'm not sure if I have something configured incorrectly or not, but I'm not really seeing any results from this extension in the IDE.
I have everything on the default settings, stack is in my PATH, and I can run the ghc-mod commands from the terminal and I see output.
I could write something that is obviously incorrect and will fail to type check, but the extension reports there are no errors.
Any ideas?
If you haven't yet, please add "haskell.ghcMod.logLevel": "log"
to your configuration and check the ghc-mod server
output channel (ctrl+shift+u opens the output panel, then click the dropdown and look for the ghc-mod channel)
Okay, so I did that and this is what I see after saving the file a few times:
Interact: check src/API/Database/Queries/Purchase.hs
Interact: check src/API/Database/Queries/Purchase.hs
Interact: check src/API/Database/Queries/Purchase.hs
Interact: check src/API/Database/Queries/Purchase.hs
Should there be any additional output here?
In the terminal, I can run ghc-mod check src/API/Database/Queries/Purchase.hs
and I see this (truncated for brevity):
Couldn't match expected type ‘DB (Maybe (Only Integer))’ with
actual type ‘a1 -> f0 (f1 a0) -> f0 (f1 b0)’
• Probable cause: ‘(.)’ is applied to too few arguments In the expression ....
So presumably ghc-mod is working.
Should I try and get more output for this issue? Let me know what else I can do to help!
Thanks for sharing the information and for your patience. Can you tell me what version of ghc-mod you have and which operating system you are using?
You can see here the code that is processing the ghc-check results.
I am using this regex: /^(.*?):([0-9]+):([0-9]+): *(?:(Warning|Error): *)?/
That obviously doesn't match the output you're getting. Also, from the tool perspective, the problem with the ghc-mod output you are receiving is that it doesn't include a severity or a location. So what should it be shown as (green, red, etc.) and where should it be shown?
If you have a repo that reproduces this I can try to take a look. If you'd like to look a bit further yourself, you can clone this repo and run the extension locally from source and set some breakpoints to verify that the regex I showed you is being hit but is failing.
Once that is verified, then an enhancement will need to be made to catch this.
No problem! Thanks for being willing to help out.
I'm using ghc-mod version 5.7.0.0 compiled by GHC 8.0.2
on macOS 10.12.4.
I don't have a repo to reproduce this issue, but it's happening for me on any Haskell project I open, so presumably if you were to use the same version of ghc-mod, I bet it would happen to you, too.
I forked this repo the other day to try and dig into this problem myself, but I had issues getting everything up and running according to the readme. I can try again.
I can also try switching to a different version of ghc-mod.
Hi there, I have exact same issue in the same ghc-mod version.