8

I have the Haskell extension installed on Visual Studio Code. This extension downloaded and installed Haskell Language Server and, for no apparent reason, sometimes it works perfectly fine and sometimes it doesn't.

When it does work, the extension is able to react to live changes in the code, highlighting all kinds of errors, warnings, etc, and displaying function documentation on the fly. Perfect stuff.

However, when it does not work, it keeps highlighting the first line of each module's file as an error, mentioning that:

Multi Cradle: No prefixes matched
pwd: /Users/jivan/haskell-descriptions
filepath: /Users/jivan/haskell-descriptions/src/Proceed.hs
prefixes:
("./src/Main.hs",Stack {component = Just "haskell-descriptions:exe:descriptions", stackYaml = Nothing})

The content of hie.yaml is the following:

cradle:
  multi:
    - path: "./"
      config:
        cradle:
          stack:
            - path: "./src/Main.hs"
              component: "haskell-descriptions:exe:descriptions"

It actually used to work without the component part in hie.yaml, however now I can't get it to work again, whether the component part is here or not.

I was told about gen-hie but no way to make it run successfully, as when I type gen-hie in a terminal, all I get as an answer is command not found: gen-hie (despite it being declared in both stack.yaml and .cabal files).

Any idea or suggestions welcome.

Jivan
  • 21,522
  • 15
  • 80
  • 131
  • I know this question is old, but for anyone searching at least the last part of the question can be solved with `stack install gen-hie` and ensuring `~/.local/bin` (if I'm not mistaken) is on your path. – samvv Aug 31 '21 at 17:51

0 Answers0