You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm using using some TemplateHaskell packages. Namely Data.Aeson.TypeScript.TH.
The code got compiled and all was good.
So it's working just great.
But if I'm debugging and try to eval in the Haskell Language Server I will get an error of module not found:
--- >>> runInterpreter $ runHint "HsToRedux_item" "2023-08-16_18-06-51"
-- Left (WontCompile [GhcError {errMsg = "_mixed/HsToRedux_item/2023-08-16_18-06-51.hs:13:1: error:\n Could not find module \8216Data.Aeson.TypeScript.TH\8217\n Use -v (or `:set -v` in ghci) to see a list of the files searched for."},GhcError {errMsg = "_mixed/HsToRedux_item/2023-08-16_18-06-51.hs:14:1: error:\n Could not find module \8216Data.Aeson.Types\8217\n Use -v (or `:set -v` in ghci) to see a list of the files searched for."}])
(I did setImports ["Prelude", "Language.Haskell.TH", "GHC.Generics", "Data.Aeson", "Data.Aeson.TypeScript.TH","Data.Aeson.Types"] just fine with set [languageExtensions := [TemplateHaskell,ScopedTypeVariables]])
or can probably be a bug somewhere in the HLS?
The text was updated successfully, but these errors were encountered:
any tips on debugging this or hacking around will be nice! Thanks!
archywillhe
changed the title
certain TemplateHaskell module not found when eval in Language Server
only when eval in Language Server: certain TemplateHaskell module not found
Aug 16, 2023
hint is not finding the package databases in which that library is installed. The README recommends using a ghc environment file in the present working directory, as I have had a good experience with that approach with both running a compiled executable, with ghci, and ghcid. However, I have not tried this approach with HLS, so it is possible that the second approach mentioned in the README, in which the ghc environment file or the package database is explicitly specified via unsafeRunInterpreterWithArgs, works better.
It is also possible that HLS is setting the GHC_PACKAGE_PATH environment variable.
So I'm using using some TemplateHaskell packages. Namely
Data.Aeson.TypeScript.TH
.The code got compiled and all was good.
So it's working just great.
But if I'm debugging and try to eval in the Haskell Language Server I will get an error of module not found:
(I did
setImports ["Prelude", "Language.Haskell.TH", "GHC.Generics", "Data.Aeson", "Data.Aeson.TypeScript.TH","Data.Aeson.Types"]
just fine withset [languageExtensions := [TemplateHaskell,ScopedTypeVariables]]
)or can probably be a bug somewhere in the HLS?
The text was updated successfully, but these errors were encountered: