You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement request related to a problem? Please describe.
I just came back to Haskell after a few years. I'm trying the latest cabal instead of stack this time around, and running into all sorts of confusing problems. See this thread for details.
In short, if you create a new project with cabal, then add a module, you get the "multi-cradle no prefixes matched" error, which doesn't mean anything to me. As a stack/hpack user, I had forgotten that cabal required this, and had no idea what the error message meant. I suspect that any new Haskellers would be equally confused.
In Visual Studio Code it highlights the first line of the second modules and ONLY shows you the following:
Multi Cradle: No prefixes matched
pwd: /Users/sean/Downloads/error-example
filepath: /Users/sean/Downloads/error-example/app/Test.hs
prefixes:
("app/Main.hs",Cabal {component = Just "error-example:exe:error-example"})
cradle
Describe the solution you'd like
I would like HLS to give a clear error message saying that I may have forgotten to add the file to the cabal file.
Note: I have a week off and I'm willing to fix this. I just want to make sure it's something that will be merged, and know about any caveats or potential issues before starting.
Steps to Reproduce
Create a new project with default options
$ cabal --version
cabal-install version 3.10.1.0
compiled using version 3.10.1.0 of the Cabal librar
$ mkdir test && cd test
$ cabal init # all default options
Add app/Test.hs with the following:
module Test where
test :: IO ()
test = putStrLn "TEST"
Import Test into Main
module Main where
import Test
main :: IO ()
main = do
putStrLn "Hello, Haskell!"
Test.test
Run HLS:
$ haskell-language-server-wrapper-2.0.0.1
...
2023-07-07T17:16:41.846129Z | Info | Cradle path: app/Test.hs
2023-07-07T17:16:41.846221Z | Warning | No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for app/Test.hs.
Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2023-07-07T17:16:41.869410Z | Info | invoking build tool to determine build flags (this may take some time depending on the cache)
2023-07-07T17:16:41.871178Z | Info | updateFileDiagnostics published different from new diagnostics - file diagnostics: File: /Users/sean/Downloads/error-example/app/Test.hs
Hidden: no
Range: 1:1-2:1
Source: cradle
Severity: DsError
Message:
Multi Cradle: No prefixes matched
pwd: /Users/sean/Downloads/error-example
filepath: /Users/sean/Downloads/error-example/app/Test.hs
prefixes:
("app/Main.hs",Cabal {component = Just "error-example:exe:error-example"})
The text was updated successfully, but these errors were encountered:
Is your enhancement request related to a problem? Please describe.
I just came back to Haskell after a few years. I'm trying the latest cabal instead of stack this time around, and running into all sorts of confusing problems. See this thread for details.
In short, if you create a new project with cabal, then add a module, you get the "multi-cradle no prefixes matched" error, which doesn't mean anything to me. As a stack/hpack user, I had forgotten that cabal required this, and had no idea what the error message meant. I suspect that any new Haskellers would be equally confused.
In Visual Studio Code it highlights the first line of the second modules and ONLY shows you the following:
Describe the solution you'd like
I would like HLS to give a clear error message saying that I may have forgotten to add the file to the cabal file.
Note: I have a week off and I'm willing to fix this. I just want to make sure it's something that will be merged, and know about any caveats or potential issues before starting.
Steps to Reproduce
module Main where
The text was updated successfully, but these errors were encountered: