Skip to content

Commit a58878a

Browse files
authored
Merge pull request #249 from pepeiborra/master
Update documentation instructions and features
2 parents 94771fa + 432b0f3 commit a58878a

File tree

1 file changed

+45
-19
lines changed

1 file changed

+45
-19
lines changed

README.md

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ This extension adds language support for [Haskell](https://haskell.org), powered
1212
- Code completion
1313
- Formatting via Brittany, Floskell, Ormolu or Stylish Haskell
1414
- [Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) support
15+
- Code evaluation (Haskell Language Server)
16+
17+
![Eval](https://i.imgur.com/bh992sT.gif)
18+
1519

1620
## Requirements
1721

@@ -52,29 +56,29 @@ There are a few placeholders which will be expanded:
5256
- `~`, `${HOME}` and `${home}` will be expanded into your users' home folder.
5357
- `${workspaceFolder}` and `${workspaceRoot}` will expand into your current project root.
5458

55-
## Local documentation
56-
57-
Haskell Language Server can display Haddock documentation on hover and in code completion for your code if you have built your project with haddock enabled.
58-
59-
For Stack projects, in your project directory run
60-
61-
```bash
62-
$ stack haddock --keep-going
63-
```
64-
65-
For Cabal projects, run
59+
## Haskell Language Server specifics
6660

67-
```bash
68-
$ cabal build --haddock
69-
```
61+
### Local documentation
7062

71-
Or alternatively add the following to your `~/.cabal/config` or `cabal.config[.local]`
63+
Haskell Language Server can display Haddock documentation on hover and completions if the project and
64+
its dependencies have been built with the `-haddock` GHC flag.
7265

73-
```json
74-
documentation: True
75-
```
66+
- For cabal:
67+
- Add to your global config file (e.g. `~/.cabal/config`):
68+
```
69+
program-default-options
70+
ghc-options: -haddock
71+
```
72+
- Or, for a single project, run `cabal configure --ghc-options=-haddock`
7673

77-
## Haskell Language Server specifics
74+
- For stack, add to global `$STACK_ROOT\config.yaml`, or project's `stack.yaml`:
75+
```
76+
ghc-options:
77+
"$everything": -haddock
78+
```
79+
Note that this flag will cause compilation errors if a dependency contains invalid Haddock markup,
80+
until GHC 8.12 which [will report warnings](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2377)
81+
instead.
7882
7983
### Downloaded binaries
8084
@@ -103,6 +107,28 @@ These are the versions of GHC that there are binaries of `haskell-language-serve
103107
104108
If you are using Haskell IDE Engine as your language server, there are a number of additional configuration options.
105109
110+
### Local documentation
111+
112+
Haskell Language Server can display Haddock documentation on hover and in code completion for your code if you have built your project with haddock enabled.
113+
114+
For Stack projects, in your project directory run
115+
116+
```bash
117+
$ stack haddock --keep-going
118+
```
119+
120+
For Cabal projects, run
121+
122+
```bash
123+
$ cabal build --haddock
124+
```
125+
126+
Or alternatively add the following to your `~/.cabal/config` or `cabal.config[.local]`
127+
128+
```json
129+
documentation: True
130+
```
131+
106132
### Liquid Haskell
107133

108134
If Liquid Haskell is installed, haskell-ide-engine can be configured to run the `liquidhaskell` executable on save and display diagnostics:

0 commit comments

Comments
 (0)