ndmitchell / ghcid

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

allow-eval ignores preprocessors #335

Closed aavogt closed 3 years ago

aavogt commented 3 years ago

I have a comment:

{-# OPTIONS_GHC -F -pgmF HListPP #-}
-- $> `blah

This becomes valid syntax if run with HListPP-0.3. But ghcid reads the original file.

Running ghc with -v prints things like

*** Haskell pre-processor:
HListPP Main.hs Main.hs /tmp/ghc19601_0/ghc_1.hspp
compile: input file /tmp/ghc19601_0/ghc_1.hspp

Those hspp files should be read by getCommands ( https://github.com/ndmitchell/ghcid/blob/52883ef368c97b013dad5c9afcf6cd9bdae9875a/src/Session.hs#L157 ) instead. But I'm not sure how to get the hspp file paths.

ndmitchell commented 3 years ago

I'm not sure that getCommands should be reading the preprocessed output. Where that output appears is fiddly. When it appears is undetermined. I think it might just be a consequence of preprocessors that they don't work perfectly with Ghcid and allow-eval stuff.

aavogt commented 3 years ago

Thanks