Skip to content

Commit 3bed408

Browse files
committed
Add documentation on choosing a formatter
1 parent 84a2274 commit 3bed408

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This is *very* early stage software.
2929
- [Building](#building)
3030
- [Install via cabal](#install-via-cabal)
3131
- [Install specific GHC Version](#install-specific-ghc-version)
32+
- [HLS LSP Configuration](#hls-lsp-configuration)
3233
- [Project Configuration](#project-configuration)
3334
- [Editor Integration](#editor-integration)
3435
- [VS Code](#using-haskell-language-server-with-vs-code)
@@ -253,6 +254,34 @@ If your desired ghc has been found, you use it to install haskell-language-serve
253254
./cabal-hls-install data
254255
```
255256

257+
## HLS LSP Configuration
258+
259+
haskell-language-server supports some forms of configuration.
260+
261+
### Formatting providers
262+
By default, haskell-language-server is compiled with support for several different formatters.
263+
264+
These include
265+
* `floskell`
266+
* `fourmolu`
267+
* `ormolu`
268+
* `stylish-haskell`
269+
* `brittany` (if compiled with AGPL)
270+
271+
To choose one of them, you need to include the name of the one you want to use
272+
as the value for the `formattingProvider` key in your LSP configuration like so:
273+
```json
274+
{
275+
...
276+
"haskell": {
277+
...
278+
"formattingProvider": "fourmolu"
279+
...
280+
}
281+
...
282+
}
283+
```
284+
256285
## Project Configuration
257286

258287
**For a full explanation of possible configurations, refer to [hie-bios/README](https://github.com/mpickering/hie-bios/blob/master/README.md).**

0 commit comments

Comments
 (0)