scturtle / flycheck-ghcmod

Haskell checker using ghc-mod.
The Unlicense
2 stars 1 forks source link

Could not find a component assignment, falling back to guessed GHC options. #1

Open luntain opened 9 years ago

luntain commented 9 years ago

Flycheck creates a file called M_flycheck.hs from the contents of the M.hs buffer. While M is mentioned among the modules in the cabal file, M_flycheck is not, and I think that is why ghc-mod warns it doesn't know what ghc options to use (among others ghc extensions). ghc-mod check finds faults with Template Haskell code in M_flycheck.hs and its dependencies which it would not if run on M.hs. Is that a known issue?

scturtle commented 9 years ago

Oh that's really a problem and I have no ideas to fix this perfectly.

A quick workaround may be to change "source-inplace" to "source-original"(doc) in this script. This forces flycheck to check the original file instead of creating a temporary one. And use (setq flycheck-check-syntax-automatically '(mode-enabled save)) to tell flycheck to check it only when saved.

luntain commented 9 years ago

This is related to: https://github.com/kazu-yamamoto/ghc-mod/issues/482