ndmitchell / ghcid

Very low feature GHCi based IDE
Other
1.13k stars 114 forks source link

Run tests + Dump splices #246

Closed dcastro closed 5 years ago

dcastro commented 5 years ago

I'm trying to setup ghcid so that it dumps TH splices and runs tests on reload. This is what I've tried so far:

ghcid \
  --command "stack ghci --test --ghci-options='-ddump-splices'" \
  --test main

However, I get the splices, but the tests won't run. I thought the extra ghci output was stopping ghcid from running the tests, so I gave --warnings a try, but that didn't help either.

Am I doing something wrong? Or is this not possible at the moment?

I'm on v0.7.4, using the latest commit on master.

ndmitchell commented 5 years ago

Can you run with --verbose and put the output in a gist.

dcastro commented 5 years ago

@ndmitchell thanks for the quick reply! I've pasted the output here: https://gist.github.com/dcastro/fd873967593df048266c4c61561576b4

ndmitchell commented 5 years ago

It seems your splices as errors. See line 5815, which features:

Message {loadSeverity = Error, loadFile = "/Users/dcastro/Dropbox/Projects/Haskell/hs-flatbuffers/test/FlatBuffers/Internal/Compiler/ParserSpec.hs", loadFilePos = (134,12), loadFilePosEnd = (138,10), loadMessage = ["/Users/dcastro/Dropbox/Projects/Haskell/hs-flatbuffers/test/FlatBuffers/Internal/Compiler/ParserSpec.hs:(134,12)-(138,10): Splicing expression

Why are you turning on dump splices? Is that because you really want dump splices, or is it just an artefact of elsewhere? Could ghcid disable dump TH splices? If they have a valid use then the solution would be to filter out the message in some way.

dcastro commented 5 years ago

It seems your splices as errors

Oh, that explains it!

Why are you turning on dump splices? Is that because you really want dump splices, or is it just an artefact of elsewhere?

I'm writing my own TemplateHaskell code, and would like to quickly see the code it generates as the prototype evolves.

ndmitchell commented 5 years ago

I'm writing my own TemplateHaskell code, and would like to quickly see the code it generates as the prototype evolves.

Won't running with --test mean that you don't see the output, as it will always scroll out of view when the test starts?

dcastro commented 5 years ago

Hmm that's a good point, maybe I should just start 2 shells, one with the dumped splices and one with the tests running. Thanks for the help!