Skip to content

Commit db18602

Browse files
authored
Merge pull request haskell#13 from fendor/document-hie-bios
Update README to contain information about hie-bios
2 parents 7fbacf7 + 3752ac9 commit db18602

File tree

1 file changed

+98
-2
lines changed

1 file changed

+98
-2
lines changed

README.md

+98-2
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ we talk to clients.__
3030
- [Windows-specific pre-requirements (optional)](#windows-specific-pre-requirements-optional)
3131
- [Download the source code](#download-the-source-code)
3232
- [Building](#building)
33+
- [Install via cabal](#install-via-cabal)
3334
- [Install specific GHC Version](#install-specific-ghc-version)
3435
- [Multiple versions of HIE (optional)](#multiple-versions-of-hie-optional)
3536
- [Configuration](#configuration)
37+
- [Explicit Configuration](#explicit-configuration)
3638
- [Editor Integration](#editor-integration)
3739
- [Using HIE with VS Code](#using-hie-with-vs-code)
3840
- [Using VS Code with Nix](#using-vs-code-with-nix)
3941
- [Using HIE with Sublime Text](#using-hie-with-sublime-text)
4042
- [Using HIE with Vim or Neovim](#using-hie-with-vim-or-neovim)
41-
- [Coc](#Coc)
42-
- [LanguageClient-neovim](#LanguageClient-neovim)
43+
- [Coc](#coc)
44+
- [LanguageClient-neovim](#languageclient-neovim)
4345
- [vim-plug](#vim-plug)
4446
- [Clone the LanguageClient-neovim repo](#clone-the-languageclient-neovim-repo)
4547
- [Sample `~/.vimrc`](#sample-vimrc)
@@ -302,6 +304,100 @@ There are some settings that can be configured via a `settings.json` file:
302304
- VS Code: These settings will show up in the settings window
303305
- LanguageClient-neovim: Create this file in `$projectdir/.vim/settings.json` or set `g:LanguageClient_settingsPath`
304306

307+
## Explicit Configuration
308+
309+
**For a full explanation of possible configuration, we refer to [hie-bios/README](https://github.com/mpickering/hie-bios/blob/master/README.md).**
310+
311+
The user can place a `hie.yaml` file in the root of the workspace which
312+
describes how to setup the environment. For example, to explicitly state
313+
that you want to use `stack` then the configuration file would look like:
314+
315+
```yaml
316+
cradle: {stack}
317+
```
318+
319+
If you use `cabal` then you probably need to specify which component you want
320+
to use.
321+
322+
```yaml
323+
cradle:
324+
cabal:
325+
component: "lib:haskell-ide-engine"
326+
```
327+
328+
Or you can explicitly state the program which should be used to collect
329+
the options by supplying the path to the program. It is interpreted
330+
relative to the current working directory if it is not an absolute path.
331+
332+
```yaml
333+
cradle:
334+
bios:
335+
program: ".hie-bios"
336+
```
337+
338+
The complete configuration is a subset of
339+
340+
```yaml
341+
cradle:
342+
cabal:
343+
component: "optional component name"
344+
stack:
345+
bazel:
346+
obelisk:
347+
bios:
348+
program: "program to run"
349+
dependency-program: "optional program to run"
350+
direct:
351+
arguments: ["list","of","ghc","arguments"]
352+
default:
353+
none:
354+
355+
dependencies:
356+
- someDep
357+
```
358+
359+
There is also support for multiple cradles in a single `hie.yaml`. An example configuration for Haskell IDE Engine:
360+
361+
```yaml
362+
cradle:
363+
multi:
364+
- path: ./test/dispatcher/
365+
config:
366+
cradle:
367+
cabal:
368+
component: "test:dispatcher-test"
369+
- path: ./test/functional/
370+
config:
371+
cradle:
372+
cabal:
373+
component: "test:func-test"
374+
- path: ./test/unit/
375+
config:
376+
cradle:
377+
cabal:
378+
component: "test:unit-test"
379+
- path: ./hie-plugin-api/
380+
config:
381+
cradle:
382+
cabal:
383+
component: "lib:hie-plugin-api"
384+
- path: ./app/MainHie.hs
385+
config:
386+
cradle:
387+
cabal:
388+
component: "exe:hie"
389+
- path: ./app/HieWrapper.hs
390+
config:
391+
cradle:
392+
cabal:
393+
component: "exe:hie-wrapper"
394+
- path: ./
395+
config:
396+
cradle:
397+
cabal:
398+
component: "lib:haskell-ide-engine"
399+
```
400+
305401
## Editor Integration
306402

307403
Note to editor integrators: there is now a `hie-wrapper` executable, which is installed alongside the `hie` executable. When this is invoked in the project root directory, it attempts to work out the GHC version used in the project, and then launch the matching `hie` executable.

0 commit comments

Comments
 (0)