If one has a project with a single executable and at least two modules and a cabal.project file, ghcide fails to process the file listed under main-is in the cabal file.
The error produced:
ghcide version: 0.2.0 (GHC: 8.6.5) (PATH: /nix/store/f6hxh9b0679v0yl5amlmwcwfj21xm4rr-ghcide-0.2.0/bin/ghcide)
Ghcide setup tester in <redacted>/minimal-example-c01.
Report bugs at https://github.com/digital-asset/ghcide/issues
Step 1/4: Finding files to test in <redacted>/minimal-example-c01
Found 1 files
Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle
Step 3/4: Initializing the IDE
Step 4/4: Type checking the files
[INFO] Consulting the cradle for "<redacted>/minimal-example-c01/src/Main.hs"
> cabal: Unknown target '<redacted>/minimal-example-c01/src/Main.hs'.
> The package minimal-example-c01 has no file target 'src/Main.hs'.
>
>
File: <redacted>/minimal-example-c01/src/Main.hs
Hidden: no
Range: 1:0-100001:0
Source: compiler
Severity: DsError
Message:
Failed to parse result of calling cabal
cabal: Unknown target '<redacted>/minimal-example-c01/src/Main.hs'.
The package minimal-example-c01 has no file target 'src/Main.hs'.
Files that failed:
* <redacted>/minimal-example-c01/src/Main.hs
Completed (0 files worked, 1 file failed)
Example project: minimal-example-c01.
Might be relevant: Used cabal-install and Cabal version 3.0.0.0
I think this is the relevant issue in cabal https://github.com/haskell/cabal/issues/6622 and the fix will be ported to cabal 3.2.0.1, iirc.
Work around is an explicit hie.yaml:
cradle:
cabal:
- path: ./src
component: "exe:minimal-example-c01"
Most helpful comment
I think this is the relevant issue in cabal https://github.com/haskell/cabal/issues/6622 and the fix will be ported to cabal 3.2.0.1, iirc.
Work around is an explicit hie.yaml: