- 'GhcPkg' now parses 'ghc-pkg -v list' output directly to also get the
package-id
- Remove unused field 'cradlePackages' in Cradle
- Remove 'getPackageDbPackages' and use 'ghcPkgListEx' instead
- cradle now stores a list of active package databases instead of only
the user store (if present).
- rename `cradlePackageDb` -> `cradlePkgDbStack` as that`s what the ghc
documentaion calls this kind of thing
- `getPackageDbPackages` now returns names of all visible packages in
the given directory. Also the implementation now uses `ghc-pkg`
instead of manually looking at the package database
This commit implement scaning a package db directory to collect package
id
If you installed a package both in a sandbox and globally, global
package may be selected even if there's a package in a sandbox, which is
different behavior from cabal sandbox.
e.g. when you have fast-logger-2.0 globally and fast-logger-0.3.3 in a
sandbox:
(Without patch)
$ ghc-mod check Foundation.hs
Foundation.hs:12:31:Module `System.Log.FastLogger' does not export `Logger'
(With patch)
$ ghc-mod check Foundation.hs
This commit add a failing test to check extracting package id. The test will
fail with the following output for now:
1) Cradle.getPackageDbPackages find a config file and extracts packages with their ids
expected: [("template-haskell",Just "template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c")]
but got: []