ghcid icon indicating copy to clipboard operation
ghcid copied to clipboard

If ghcid is started with a compile error it doesn't recognise the test value.

Open seanparsons opened this issue 6 years ago • 3 comments

If I start ghcid with the following command with currently compiling code my app starts up fine:

ghcid --command 'cabal new-repl myproject' --setup='import Main' --test=':main'

Should I break something it'll catch that and start up with issue if it's then fixed.

If the code at the point I run the above command doesn't compile and then I subsequently fix it then I see this:

<interactive>:45:53-56: error:
    • Variable not in scope: main :: IO a0
    • Perhaps you meant ‘min’ (imported from Protolude)

...done

I don't think I've configured it incorrectly, but I'm not 100% certain of that.

seanparsons avatar Jan 07 '19 22:01 seanparsons

The problem is that ghcid hasn't managed to find the warnings/errors that are coming out of the project. Are you using the latest version of ghcid? If so, please run with --verbose, without --test=:main. Load it working, then break something, and share the log.

ndmitchell avatar Jan 08 '19 16:01 ndmitchell

It's the other way around though, when it's loaded broken and then fixed.

seanparsons avatar Jan 08 '19 16:01 seanparsons

Hmm. Either way, a log would be interesting. Sometimes GHC fails to reload things, as it's a bit buggy in ghci, but I find that's rare rather than common.

ndmitchell avatar Jan 08 '19 16:01 ndmitchell