jyp / dante

391 stars 52 forks source link

Could not find module #132

Closed cxandru closed 4 years ago

cxandru commented 4 years ago

I have a package.yaml file that looks like this:

name: ar-proj

ghc-options: -Wall

dependencies:
  - base < 5
  - z3

source-dirs: src

now I have a module called Main.hs in the src directory where I want to import another module, Trucks.hs, also in the src directory. What happens is that dante tells me Could not find module Trucks. Why is this happening? I am developing under nixos with a shell.nix that reads a package.yaml. Dante correctly recognizes the project root, also in module Trucks I can use it normally, it also recognizes symbols from the z3 library.

cxandru commented 4 years ago

Ok, the problem is that a .cabal file needs to be present, it's not enough if you use cabal2nix in your nix-shell to generate it ad-hoc. Probably not worth fixing, just have to remember to rerun hpack when you change your package.yaml

jyp commented 4 years ago

:+1: