Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 3752ac9

Browse files
committed
Better README
1 parent 57737df commit 3752ac9

File tree

1 file changed

+44
-33
lines changed

1 file changed

+44
-33
lines changed

README.md

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ we talk to clients.__
3434
- [Install specific GHC Version](#install-specific-ghc-version)
3535
- [Multiple versions of HIE (optional)](#multiple-versions-of-hie-optional)
3636
- [Configuration](#configuration)
37-
- [hie-bios](#hie-bios)
38-
- [Explicit Configuration](#explicit-configuration)
37+
- [Explicit Configuration](#explicit-configuration)
3938
- [Editor Integration](#editor-integration)
4039
- [Using HIE with VS Code](#using-hie-with-vs-code)
4140
- [Using VS Code with Nix](#using-vs-code-with-nix)
@@ -305,37 +304,7 @@ There are some settings that can be configured via a `settings.json` file:
305304
- VS Code: These settings will show up in the settings window
306305
- LanguageClient-neovim: Create this file in `$projectdir/.vim/settings.json` or set `g:LanguageClient_settingsPath`
307306

308-
## [hie-bios](https://github.com/mpickering/hie-bios)
309-
310-
`hie-bios` is the way which
311-
[`hie`](https://github.com/haskell/haskell-ide-engine) sets up a GHC API session.
312-
313-
Given a Haskell project that is managed by Stack, Cabal, or other package tools,
314-
`hie` needs to know the full set of flags to pass to GHC in order to build the
315-
project. `hie-bios` satisfies this need.
316-
317-
Its design is motivated by the guiding principle:
318-
319-
> It is the responsibility of the build tool to describe the environment
320-
> which a package should be built in.
321-
322-
Using this principle, it is possible
323-
to easily support a wide range of tools including `cabal-install`, `stack`,
324-
`rules_haskell`, `hadrian` and `obelisk` without major contortions.
325-
`hie-bios` does not depend on the `Cabal` library nor does not
326-
read any complicated build products and so on.
327-
328-
How does a tool specify a session? A session is fully specified by a set of
329-
standard GHC flags. Most tools already produce this information if they support
330-
a `repl` command. Launching a repl is achieved by calling `ghci` with the
331-
right flags to specify the package database. `hie-bios` needs a way to get
332-
these flags and then it can set up GHC API session correctly.
333-
334-
Futher it means that any failure to set up the API session is the responsibility
335-
of the build tool. It is up to them to provide the correct information if they
336-
want `hie` to work correctly.
337-
338-
### Explicit Configuration
307+
## Explicit Configuration
339308

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

@@ -387,6 +356,48 @@ dependencies:
387356
- someDep
388357
```
389358

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+
390401
## Editor Integration
391402

392403
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)