Skip to content

Commit

Permalink
Merge #2990
Browse files Browse the repository at this point in the history
2990: Improve scripts for haskell-language-server and ghci r=rvl a=rvl

It now generates a custom HLS config on the fly. Instructions are in `hie-direnv.yaml`.

### Issue Number

ADP-1229


Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
  • Loading branch information
iohk-bors[bot] and rvl committed Oct 26, 2021
2 parents 0c1daac + 927c8b8 commit 618509a
Show file tree
Hide file tree
Showing 28 changed files with 804 additions and 195 deletions.
28 changes: 28 additions & 0 deletions hie-direnv.yaml
@@ -0,0 +1,28 @@
########################################################################
# Custom configuration for haskell-language-server.
#
# Use this instead of the default Stack cradle if you want faster
# reloads and cross-package jump-to-definition.
#
# It requires nix-direnv and your editor must have direnv integration.
#
# To use it, symlink hie-direnv.yaml to hie.yaml.
# Then prepare your environment:
# 1. $ direnv allow
# (this will build and cache the nix-shell)
# 2. $ cabal configure --enable-tests --enable-benchmarks -O0
# (this will provide the build plan which is the basis of the cradle)
# 3. $ cabal build all
# (this will build the Cabal autogen Paths_ modules)
#
# Test your configuration with commands such as:
# $ hie-bios check lib/core/src/Cardano/Wallet.hs
# $ haskell-language-server lib/shelley/exe/cardano-wallet.hs
#
# See https://github.com/haskell/hie-bios for information about the
# cradle yaml config format.
########################################################################

cradle:
bios:
program: "./scripts/hie-bios.sh"
2 changes: 1 addition & 1 deletion lib/cli/cardano-wallet-cli.cabal
Expand Up @@ -85,6 +85,6 @@ test-suite unit
hs-source-dirs:
test/unit
main-is:
Main.hs
cli-unit-test.hs
other-modules:
Cardano.CLISpec
File renamed without changes.
2 changes: 2 additions & 0 deletions lib/core/test/bench/db/Main.hs → lib/core/bench/db-bench.hs
Expand Up @@ -39,6 +39,8 @@
-- there are database statements with more parameters than that, the DBLayer
-- will throw exceptions.

module Main where

import Prelude

import Cardano.Address.Derivation
Expand Down
10 changes: 5 additions & 5 deletions lib/core/cardano-wallet-core.cabal
Expand Up @@ -362,10 +362,10 @@ test-suite unit
type:
exitcode-stdio-1.0
hs-source-dirs:
test-common
test/unit
test/shared
main-is:
Main.hs
core-unit-test.hs
other-modules:
Cardano.Byron.Codec.CborSpec
Cardano.DB.Sqlite.DeleteSpec
Expand Down Expand Up @@ -472,9 +472,9 @@ benchmark db
type:
exitcode-stdio-1.0
hs-source-dirs:
test/bench/db
test/shared
bench
test-common
main-is:
Main.hs
db-bench.hs
other-modules:
Cardano.Wallet.DummyTarget.Primitive.Types
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/launcher/cardano-wallet-launcher.cabal
Expand Up @@ -93,7 +93,7 @@ test-suite unit
hs-source-dirs:
test/unit
main-is:
Main.hs
launcher-unit-test.hs
other-modules:
Cardano.LauncherSpec
, Cardano.StartupSpec
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/numeric/cardano-numeric.cabal
Expand Up @@ -59,6 +59,6 @@ test-suite unit
hs-source-dirs:
test/unit
main-is:
Main.hs
numeric-unit-test.hs
other-modules:
Cardano.Numeric.UtilSpec
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions lib/shelley/cardano-wallet.cabal
Expand Up @@ -245,7 +245,7 @@ test-suite unit
hs-source-dirs:
test/unit
main-is:
Main.hs
shelley-unit-test.hs
other-modules:
Cardano.Wallet.Shelley.CompatibilitySpec
Cardano.Wallet.Shelley.Compatibility.LedgerSpec
Expand Down Expand Up @@ -293,7 +293,7 @@ test-suite integration
hs-source-dirs:
test/integration
main-is:
Main.hs
shelley-integration-test.hs
other-modules:
Cardano.Wallet.Shelley.Faucet

Expand Down Expand Up @@ -332,7 +332,7 @@ benchmark restore
hs-source-dirs:
bench
main-is:
Restore.hs
restore-bench.hs

benchmark latency
default-language:
Expand Down Expand Up @@ -368,6 +368,6 @@ benchmark latency
bench
test/integration
main-is:
Latency.hs
latency-bench.hs
other-modules:
Cardano.Wallet.Shelley.Faucet
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/test-utils/cardano-wallet-test-utils.cabal
Expand Up @@ -110,6 +110,6 @@ test-suite unit
hs-source-dirs:
test
main-is:
Main.hs
test-utils-unit-test.hs
other-modules:
Test.Hspec.ExtraSpec
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/text-class/text-class.cabal
Expand Up @@ -68,6 +68,6 @@ test-suite unit
hs-source-dirs:
test/unit
main-is:
Main.hs
text-class-unit-test.hs
other-modules:
Data.Text.ClassSpec
246 changes: 246 additions & 0 deletions nix/materialized/hie-bios/.plan.nix/hie-bios.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 618509a

Please sign in to comment.