haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 209 forks source link

Could not obtain flags for: "Setup.hs". #1772

Closed GGXBoo closed 4 years ago

GGXBoo commented 4 years ago

I try to run hie - r . in the root directory of the stack project.I got a mistake:

/home/ggx/Documents/hsProject/Test/app/Main.hs: FAILED
        "cannot satisfy -package-id Test-0.1.0.0-HK9i1m1pnE35zUxSYHWtx0\n    (use -v for more information)"
/home/ggx/Documents/hsProject/Test/Setup.hs: FAILED
        Fail on initialisation for "/home/ggx/Documents/hsProject/Test/Setup.hs". Could not obtain flags for: "Setup.hs".
/home/ggx/Documents/hsProject/Test/test/Spec.hs: FAILED
        Fail on initialisation for "/home/ggx/Documents/hsProject/Test/test/Spec.hs". Could not obtain flags for: "test/Spec.hs".

I use stack tool version 2.3.1 and GHC version 8.8.3.

Avi-D-coder commented 4 years ago

Install and use gen-hie to generate a hie.yaml file. In your project run stack build then gen-hie > hie.yaml(or the windows equivalent of >).

An explicit hie.yaml file should fix everything, except Setup.hs(there is no way to load Setup.hs).

GGXBoo commented 4 years ago

In your project run stack build then

Yes. I am try it.Now there's only one mistake left:

/home/ggx/Documents/stack/Hello/Setup.hs: FAILED
    Fail on initialisation for "/home/ggx/Documents/stack/Hello/Setup.hs". Multi Cradle: No prefixes matched
Avi-D-coder commented 4 years ago

This is expected nothing can load Setup.hs files. Opening other files will work just fine in your editor.