You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
[`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
339
308
340
309
**For a full explanation of possible configuration, we refer to [hie-bios/README](https://github.com/mpickering/hie-bios/blob/master/README.md).**
341
310
@@ -387,6 +356,48 @@ dependencies:
387
356
- someDep
388
357
```
389
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
+
390
401
## Editor Integration
391
402
392
403
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