diff --git a/README.md b/README.md index fe0c339b07..e2a83f310c 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 b82a997749..fb92662e1b 100644 --- a/hie.yaml.cbl +++ b/hie.yaml.cbl @@ -2,25 +2,37 @@ # in hie, using cabal as the build system. To use is, copy it to a # file called 'hie.yaml' cradle: - cabal: + multi: + - path: "./test/testdata/" + config: { cradle: { none: } } - - path: "./test/functional/" - component: "haskell-language-server:func-test" + - path: "./" + config: + cradle: + cabal: + - path: "./test/functional/" + component: "haskell-language-server:func-test" - - path: "./test/utils/" - component: "haskell-language-server:func-test" + - path: "./test/utils/" + component: "haskell-language-server:func-test" + + - path: "./exe/Main.hs" + component: "haskell-language-server:exe:haskell-language-server" + + - path: "./exe/Arguments.hs" + component: "haskell-language-server:exe:haskell-language-server" - - path: "./exe/Main.hs" - component: "haskell-language-server:exe:haskell-language-server" + - path: "./exe/Wrapper.hs" + component: "haskell-language-server:exe:haskell-language-server-wrapper" + + - path: "./src" + component: "lib:haskell-language-server" - - path: "./exe/Wrapper.hs" - component: "haskell-language-server:exe:haskell-language-server-wrapper" - - - path: "./src" - component: "lib:haskell-language-server" - - - path: "./ghcide/src" - component: "ghcide:lib:ghcide" - - - path: "./ghcide/exe" - component: "ghcide:exe:ghcide" + - path: "./.stack-work/" + component: "lib:haskell-language-server" + + - path: "./ghcide/src" + component: "ghcide:lib:ghcide" + + - path: "./ghcide/exe" + component: "ghcide:exe:ghcide" diff --git a/hie.yaml.stack b/hie.yaml.stack index 8f06c91138..54f5f3abb0 100644 --- a/hie.yaml.stack +++ b/hie.yaml.stack @@ -2,24 +2,37 @@ # in hie, using stack as the build system. To use is, copy it to a # file called 'hie.yaml' cradle: - stack: - - path: "./test/functional/" - component: "haskell-language-server:func-test" + multi: + - path: "./test/testdata/" + config: { cradle: { none: } } - - path: "./test/utils/" - component: "haskell-language-server:func-test" + - path: "./" + config: + cradle: + stack: + - path: "./test/functional/" + component: "haskell-language-server:func-test" - - path: "./exe/Main.hs" - component: "haskell-language-server:exe:haskell-language-server" + - path: "./test/utils/" + component: "haskell-language-server:func-test" - - path: "./exe/Wrapper.hs" - component: "haskell-language-server:exe:haskell-language-server-wrapper" + - path: "./exe/Main.hs" + component: "haskell-language-server:exe:haskell-language-server" + + - path: "./exe/Arguments.hs" + component: "haskell-language-server:exe:haskell-language-server" - - path: "./src" - component: "haskell-language-server:lib" + - path: "./exe/Wrapper.hs" + component: "haskell-language-server:exe:haskell-language-server-wrapper" + + - path: "./src" + component: "haskell-language-server:lib" - - path: "./ghcide/src" - component: "ghcide:lib:ghcide" - - - path: "./ghcide/exe" - component: "ghcide:exe:ghcide" + - path: "./.stack-work/" + component: "haskell-language-server:lib" + + - path: "./ghcide/src" + component: "ghcide:lib:ghcide" + + - path: "./ghcide/exe" + component: "ghcide:exe:ghcide" diff --git a/install/hie.yaml.cbl b/install/hie.yaml.cbl new file mode 100644 index 0000000000..8e3e7a02bd --- /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 0000000000..762c2dff79 --- /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 0000000000..ab3036601c --- /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 ]