Hi, I am very new to Haskell and am trying to import a custom module from one file to another but am running into some issues with VSCode/HLS.
Running ‘cabal build’ works fine, but the module imports are highlighted with the message, “Could not find module ‘(my module name)’ It is not a module in the current program, or in any known package.”
Please let me know if this is a common issue and if I can provide any more context.
Additional info:
The module is in my cabal file under ‘other-modules’ and ‘autogen-modules’
@fendor I’m surprised not to see this gotcha mentioned in the docs. I’m sure I’ve seen a few people on here before with the same problem. I’d make a PR to add it, but I don’t quite have the full picture. Is it VSCode-specific, or are there equivalents for other editors?
I have faced this many times.
The sad thing is HLS doesn’t work well with Cabal lol.
Though on the website they say it’s world class tooling, changing Cabal file, freezes HLS or sum
I usually restart the HLS server
I’ve used many versions of HLS with neovim and haskell-tools.nvim without a problem. I compile using ghcup and it works how I’d expect with Cabal. I doubt this is being caused because of an incompatibility with those tools