From 27d35574813b7b59c02ac0c24065a4636a69ce51 Mon Sep 17 00:00:00 2001 From: sir4ur0n Date: Sat, 6 Jun 2020 00:26:32 +0200 Subject: [PATCH] Improve following Github discussions * Add stack.yaml to install/ folder * Add Stack and Cabal templates for hie.yaml for install/ folder * Add and cleanup documentation about hie.yaml * Add comment about building for Stack --- README.md | 30 +++++++++++++++++++++--------- hie.yaml.cbl | 3 --- hie.yaml.stack | 3 --- install/hie.yaml.cbl | 3 +++ install/hie.yaml.stack | 3 +++ install/stack.yaml | 13 +++++++++++++ 6 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 install/hie.yaml.cbl create mode 100644 install/hie.yaml.stack create mode 100644 install/stack.yaml diff --git a/README.md b/README.md index fe0c339b0..e2a83f310 100644 --- a/README.md +++ b/README.md @@ -497,15 +497,27 @@ args = ["--lsp"] ### Hacking on haskell-language-server -Haskell-language-server can be used on its own project. We have supplied -preset samples of `hie.yaml` files for stack and cabal, simply copy -the appropriate template to `hie.yaml` and it should work. +Haskell-language-server can be used on itself. We provide +preset samples of `hie.yaml` for Cabal and Stack. -- `hie.yaml.cbl` for cabal -- `hie.yaml.stack` for stack +Note: the `./install/` folder is not directly tied to the project so it has dedicated `./install/hie.yaml.[cbl|stack]` +templates. -Two sample `hie.yaml` files are provided, `hie.yaml.stack` for stack -usage, `hie.yaml.cbl` for cabal. Simply copy the relevant one to be -`hie.yaml` and it should work. +#### Using Cabal -The developers tend to hang out at [our IRC channel](https://webchat.freenode.net/?channels=haskell-ide-engine) at `#haskell-ide-engine` on `freenode`. +```shell +$ cp hie.yaml.cbl hie.yaml +$ cp install/hie.yaml.cbl install/hie.yaml +``` + +#### Using Stack + +Note: Stack project must also be built once until [this issue](https://github.com/commercialhaskell/stack/issues/5213) is fixed. + +```shell +$ cp hie.yaml.stack hie.yaml +$ cp install/hie.yaml.stack install/hie.yaml +$ stack build --test --no-run-tests +$ cd install +$ stack build +``` diff --git a/hie.yaml.cbl b/hie.yaml.cbl index 1f611021d..fb92662e1 100644 --- a/hie.yaml.cbl +++ b/hie.yaml.cbl @@ -6,9 +6,6 @@ cradle: - path: "./test/testdata/" config: { cradle: { none: } } - - path: "./install/" - config: { cradle: { none: } } - - path: "./" config: cradle: diff --git a/hie.yaml.stack b/hie.yaml.stack index 3beb9a88a..54f5f3abb 100644 --- a/hie.yaml.stack +++ b/hie.yaml.stack @@ -6,9 +6,6 @@ cradle: - path: "./test/testdata/" config: { cradle: { none: } } - - path: "./install/" - config: { cradle: { none: } } - - path: "./" config: cradle: diff --git a/install/hie.yaml.cbl b/install/hie.yaml.cbl new file mode 100644 index 000000000..8e3e7a02b --- /dev/null +++ b/install/hie.yaml.cbl @@ -0,0 +1,3 @@ +cradle: + cabal: + component: "lib:hls-install" diff --git a/install/hie.yaml.stack b/install/hie.yaml.stack new file mode 100644 index 000000000..762c2dff7 --- /dev/null +++ b/install/hie.yaml.stack @@ -0,0 +1,3 @@ +cradle: + stack: + component: "hls-install:lib" diff --git a/install/stack.yaml b/install/stack.yaml new file mode 100644 index 000000000..ab3036601 --- /dev/null +++ b/install/stack.yaml @@ -0,0 +1,13 @@ +resolver: lts-14.27 # Last 8.6.5 + +packages: + - . + +extra-deps: + - cabal-install-parsers-0.3.0.1 + - Cabal-3.2.0.0 + - binary-instances-1.0.0.1 + - lukko-0.1.1.2 + +nix: + packages: [ icu libcxx zlib ]