vscode-ghc-mod icon indicating copy to clipboard operation
vscode-ghc-mod copied to clipboard

Not seeing extension output in VSCode

Open caneroj1 opened this issue 7 years ago • 6 comments

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?

caneroj1 avatar Apr 30 '17 20:04 caneroj1

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)

hoovercj avatar May 01 '17 07:05 hoovercj

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.

caneroj1 avatar May 01 '17 12:05 caneroj1

Should I try and get more output for this issue? Let me know what else I can do to help!

caneroj1 avatar May 05 '17 01:05 caneroj1

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.

hoovercj avatar May 09 '17 08:05 hoovercj

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.

caneroj1 avatar May 09 '17 23:05 caneroj1

Hi there, I have exact same issue in the same ghc-mod version.

kai-wang avatar May 27 '17 01:05 kai-wang