Skip to content

Commit

Permalink
doc(hack): Add explanation to hack and test HLS
Browse files Browse the repository at this point in the history
  • Loading branch information
sir4ur0n committed Aug 16, 2020
1 parent 23dda97 commit b3118e2
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ This returns an error in HLS if 'tasty-discover' is not in the path: `could not
- Fork this repo and hack as much as you can.
- Ask @alanz or @hvr to join the project.

### Hacking on haskell-language-server
### Building haskell-language-server

Haskell-language-server can be used on itself. We provide
preset samples of `hie.yaml` for Cabal and Stack.
Expand All @@ -577,3 +577,25 @@ $ stack build --test --no-run-tests
$ cd install
$ stack build
```

### Hacking on haskell-language-server

#### Introduction tutorial
Pepeiborra [wrote an tutorial](https://github.com/pepeiborra/hls-tutorial) on writing a plugin in HLS.

#### Test your hacked HLS in your editor
If you want to test HLS while hacking on it, follow the steps below.

To do once:
- Open some codebase on which you want to test your hacked HLS in your favorite editor
- Configure this editor to use your custom HLS executable
- With Cabal: `<path to HLS project>/haskell-language-server/dist-newstyle/build/<os>/<ghc version>/haskell-language-server-<HLS version>/x/haskell-language-server/build/haskell-language-server/haskell-language-server`
- With Stack: `<path to HLS project>/haskell-language-server/.stack-work/dist/<os>/Cabal-<Cabal version>/build/haskell-language-server/haskell-language-server`

To do every time you changed code and want to test it:
- Build HLS
- With Cabal: `cabal build exe:haskell-language-server`
- With Stack: `stack build haskell-language-server:exe:haskell-language-server`
- Restart HLS
- With VS Code: `Haskell: Restart Haskell LSP Server`

0 comments on commit b3118e2

Please sign in to comment.