haskell-language-server+emacsでのハマりどころ2020年夏

Setup.hs

Setup.hsに対するエラー

prefix not foundみたいなのや、エラーがログからは見当たらなかったりするが、とにかくfaied filesのSetup.hsが入る

次のhie.yamlでSetup.hsは解決した

cradle:  
  multi:
    - path: "./"
      config:
        cradle:
          stack:
            - path: "./src"
              component: "cooking-recipe-dsl:lib"
            - path: "./app/Main.hs"
              component: "cooking-recipe-dsl:exe:cooking-recipe-dsl-exe"
            - path: "./app/Paths_cooking_recipe_dsl.hs"
              component: "cooking-recipe-dsl:exe:cooking-recipe-dsl-exe"
            - path: "./test"
              component: "cooking-recipe-dsl:test:cooking-recipe-dsl-test"
    - path: ./Setup.hs
      config:
        cradle:
          direct:
            arguments:
              - "-package Cabal"
              - "-package base"

rootDirがおかしいっぽい

Module "/home/daishi/a" is loaded by Cradle: Cradle {cradleRootDir = "/home/daishi", cradleOptsProg = CradleAction: Default}  
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 0.2.2.0, Git revision 4fe0f7dfc1cac850a1a1a201fff41cdecc0fb7cf (423 commits) x86_64 ghc-8.8.4  
Current directory: /home/daishi  
Operating system: linux  
Arguments: ["--lsp","-d","-l","/tmp/hie.log"]  
Cradle directory: /home/daishi  
Cradle type: Default  
Consulting the cradle to get project GHC version...  
Cradle requires ghc but couldn't find it  
Cradle {cradleRootDir = "/home/daishi", cradleOptsProg = CradleAction: Default}

Process hie stderr finished

haskell-language-server-wrapperを止めてバージョン込みで直接haskell-language-server-x.y.zを指定したら直った.