Can not load test/Main.hs with a hie-bios cabal cradle #1727
Description
MacOS Catalina 10.15.4, Xcode-11.4, current ghcup
that installed GHC 8.8.3 and Cabal-3.2.0.0.
Current HIE master, built with Cabal for target hie-8.8.3
.
Current VSCode with Haskell Language Server plugin 0.0.37 (and a few more plugins).
I'm trying to add HSpec framework to the tests.
Problem: the very first import Test.Hspec
is highlighted as an error. See the screenshot:
Here's the error message from the "Problems" tab:
{
"resource": "/Users/ur20980/Src/Str2Split/test/Spec.hs",
"owner": "Haskell HIE (Str2Split)",
"severity": 8,
"message": "Fail on initialisation for \"/Users/ur20980/Src/Str2Split/test/Spec.hs\".\nFailed to parse result of calling cabal\n\ncabal: Unknown target '/Users/ur20980/Src/Str2Split/test/Spec.hs'.\nThe package Str2Split has no file target 'test/Spec.hs'.\n\n\n\n\n",
"source": "bios",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 2,
"endColumn": 1
}
You see the complete content of test/Spec.hs
above. Here's Str2Split.cabal
:
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.31.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 295f93990a5fee525c421b111658ccb55aa40dfb968670dede78f92d405738ba
name: Str2Split
version: 0.1.0.0
description: Please see the README on GitHub at <https://github.com/mouse07410/Str2Split#readme>
homepage: https://github.com/mouse07410/Str2Split#readme
bug-reports: https://github.com/mouse07410/Str2Split/issues
author: Mouse
copyright: Copyright (C) 2019 Mouse
license: BSD3
license-file: LICENSE
build-type: Simple
extra-source-files:
README.md
ChangeLog.md
source-repository head
type: git
location: https://github.com/mouse07410/Str2Split
library
exposed-modules:
Lib
other-modules:
Paths_Str2Split
hs-source-dirs:
src
build-depends:
base >=4.7 && <5
default-language: Haskell2010
executable Str2Split-exe
main-is: Main.hs
other-modules:
Paths_Str2Split
hs-source-dirs:
app
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
Str2Split
, base >=4.7 && <5
default-language: Haskell2010
test-suite Str2Split-test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Paths_Str2Split
hs-source-dirs:
test
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
Str2Split
, base >=4.7 && <5
, hspec >=2.7
, QuickCheck >=2.13
default-language: Haskell2010
Both Cabal and Stack seem to be able to build both executables Str2Split-exe
and Str2Split-test
fine, despite the error messages. I can run both of them.
If you'd like to see the complete project - please see https://github.com/mouse07410/Str2Split.git
I do not claim that it's a bug - likely a pilot error. But would appreciate any help, please.