-
Notifications
You must be signed in to change notification settings - Fork 30
TemplateHaskell breaks IDE features #146
Comments
Try building it. Most likely, you have some sort of problem with your TH. In any case, TH works fine for me, so this is not universal. |
Hello. The code builds fine; it's not a compilation problem. Literally just
|
Okay. Some sanity checks first. Could you tell me your
? Also, is it cabal, stack or plain project? Lastly, does running ghc-mod directly from terminal work? F.ex. given this Haskell source in {-# LANGUAGE TemplateHaskell #-}
main :: IO () (yes, it is a signature without an accompanying binding) what is output of
? |
I'm out of town for a few days but I'll tell you what I can remember now.
Ghc is 7.10.3
Ghc-mod is 5.5.0.0
Atom is 1.6.0 with all packages updated.
OS is Arch Linux 64bit, kernel 4.4.1.
Project is stack-based.
I'll get back you with the rest when I get back home next week.
|
I'm getting this on my laptop too so I can trying
Aha! So there's a CLI problem but the atom plugin didn't present it. Ok, let's try....
Hmmm....
Erm. Now what? (FYI I'm a Haskell noob so apologies if there's something obvious I'm missing here.) |
Oh my... Your system is kinda borked I fear. Welcome to cabal hell. Run |
Cabal hell indeed. I wiped my And that was on my laptop. Now that I'm back home, I tried it again on my desktop where I originally saw the error and guess what?
😫 So I dutifully wiped my Why does it all have to be so hard? How is everyone else installing this stuff? After wiping, I'm just doing:
|
Okay, now it looks like you're mixing cabal-install and stack, which is usually a bad idea unless you know exactly what you're doing. If you're working on stack project, easy solution: go to project folder, do If you're working on cabal project, it gets a little bit more convoluted, but long story short, sandbox everything (i.e. do Why this happens: GHC is very picky about library versions. And ghc-mod is, simply put, a thick wrapper over core GHC library. So when something differs between environments in which you built ghc-mod and a project you're running it on, it can lead to all kinds of unexpected results. Sorry I can't be of more help. |
Thank you for the advice! You filled me with hope and so I wiped my Once it was done I ran
😭 It's got to be the same as this: DanielG/ghc-mod#762 |
Okay, since this is basically a GHC bug https://ghc.haskell.org/trac/ghc/ticket/12147, there's no real reason to keep this open. Sorry I can't offer a workaround. |
Using
{-# LANGUAGE TemplateHaskell #-}
causes the IDE to report 0 errors and 0 warnings, and prevents type inspections from working, even for other files in the project.
The text was updated successfully, but these errors were encountered: