Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(hack): Add explanation to hack and test HLS #329

Merged
merged 3 commits into from
Aug 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ This is *very* early stage software.
- [Preprocessor](#preprocessor)
- [Contributing](#contributing)
- [It's time to join the project!](#its-time-to-join-the-project)
- [Building haskell-language-server](#building-haskell-language-server)
- [Hacking on haskell-language-server](#hacking-on-haskell-language-server)

## Features

Expand Down Expand Up @@ -551,7 +553,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 +579,27 @@ $ 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:
- On Unix systems: `cabal exec which haskell-language-server`
- On Windows: `cabal exec where haskell-language-server`
- With Stack: `$(stack path --dist-dir)/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`