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.
Or you can explicitly state the program which should be used to collect
387
+
the options by supplying the path to the program. It is interpreted
388
+
relative to the current working directory if it is not an absolute path.
389
+
390
+
```yaml
391
+
cradle:
392
+
bios:
393
+
program: ".hie-bios"
394
+
```
395
+
396
+
The complete configuration is a subset of
397
+
398
+
```yaml
399
+
cradle:
400
+
cabal:
401
+
component: "optional component name"
402
+
stack:
403
+
component: "optional component name"
404
+
bios:
405
+
program: "program to run"
406
+
dependency-program: "optional program to run"
407
+
direct:
408
+
arguments: ["list","of","ghc","arguments"]
409
+
default:
410
+
none:
411
+
412
+
dependencies:
413
+
- someDep
414
+
```
415
+
416
+
There is also support for multiple cradles in a single `hie.yaml`. An example configuration for Haskell IDE Engine:
417
+
418
+
```yaml
419
+
cradle:
420
+
multi:
421
+
- path: ./test/dispatcher/
422
+
config:
423
+
cradle:
424
+
cabal:
425
+
component: "test:dispatcher-test"
426
+
- path: ./test/functional/
427
+
config:
428
+
cradle:
429
+
cabal:
430
+
component: "test:func-test"
431
+
- path: ./test/unit/
432
+
config:
433
+
cradle:
434
+
cabal:
435
+
component: "test:unit-test"
436
+
- path: ./hie-plugin-api/
437
+
config:
438
+
cradle:
439
+
cabal:
440
+
component: "lib:hie-plugin-api"
441
+
- path: ./app/MainHie.hs
442
+
config:
443
+
cradle:
444
+
cabal:
445
+
component: "exe:hie"
446
+
- path: ./app/HieWrapper.hs
447
+
config:
448
+
cradle:
449
+
cabal:
450
+
component: "exe:hie-wrapper"
451
+
- path: ./
452
+
config:
453
+
cradle:
454
+
cabal:
455
+
component: "lib:haskell-ide-engine"
456
+
```
457
+
306
458
## Editor Integration
307
459
308
460
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.
@@ -545,10 +697,10 @@ Or you can set the environment variable `HIE_HOOGLE_DATABASE` to specify a speci
545
697
### Planned Features
546
698
547
699
-[x] Multiproject support
700
+
-[x] New-build support
548
701
-[ ] Project wide references
549
702
-[ ] Cross project find definition
550
-
-[ ] New-build support
551
-
-[ ] HaRe refactorings
703
+
-[ ] More HaRe refactorings
552
704
-[ ] More code actions
553
705
-[ ] Cross project/dependency Find Definition
554
706
-[ ] Case splitting, type insertion etc.
@@ -644,18 +796,43 @@ Delete any `.ghc.environment*` files in your project root and try again. (At the
644
796
#### Otherwise
645
797
Try running `cabal update`.
646
798
647
-
### Nix: cabal-helper, No such file or directory
799
+
### Liquid Haskell
800
+
801
+
Liquid Haskell requires an SMT solver on the path. We do not take care of installing one, thus, Liquid Haskell will not run until one is installed.
802
+
The recommended SMT solver is [z3](https://github.com/Z3Prover/z3). To run the tests, it is also required to have an SMT solver on the path, otherwise the tests will fail for Liquid Haskell.
803
+
804
+
### Profiling `haskell-ide-engine`.
648
805
649
-
An error on stderr like
806
+
If you think `haskell-ide-engine` is using a lot of memory then the most useful
807
+
thing you can do is prepare a profile of the memory usage whilst you're using
808
+
the program.
809
+
810
+
1. Add `profiling: True` to the cabal.project file of `haskell-ide-engine`
811
+
2.`cabal new-build hie`
812
+
3. (IMPORTANT) Add `profiling: True` to the `cabal.project` file of the project you want to profile.
813
+
4. Make a wrapper script which calls the `hie` you built in step 2 with the additional options `+RTS -hd -l-au`
814
+
5. Modify your editor settings to call this wrapper script instead of looking for `hie` on the path
815
+
6. Try using `h-i-e` as normal and then process the `*.eventlog` which will be created using [`eventlog2html`](http://hackage.haskell.org/package/eventlog2html).
816
+
7. Repeat the process again using different profiling options if you like.
817
+
818
+
#### Using `ghc-events-analyze`
819
+
820
+
`haskell-ide-engine` contains the necessary tracing functions to work with [`ghc-events-analyze`](http://www.well-typed.com/blog/2014/02/ghc-events-analyze/). Each
821
+
request which is made will emit an event to the eventlog when it starts and finishes. This way you
822
+
can see if there are any requests which are taking a long time to complete or are blocking.
823
+
824
+
1. Make sure that `hie` is linked with the `-eventlog` option. This can be achieved by adding the flag
825
+
to the `ghc-options` field in the cabal file.
826
+
2. Run `hie` as normal but with the addition of `+RTS -l`. This will produce an eventlog called `hie.eventlog`.
827
+
3. Run `ghc-events-analyze` on the `hie.eventlog` file to produce the rendered SVG. Warning, this might take a while and produce a big SVG file.
828
+
829
+
The default options for `ghc-events-analyze` will produce quite a wide chart which is difficult to view. You can try using less buckets in order
830
+
to make the chart quicker to generate and faster to render.
can happen because cabal-helper compiles and runs above executable at runtime without using nix-build, which means a Nix garbage collection can delete the paths it depends on. Delete ~/.cache/cabal-helper and restart HIE to fix this.
836
+
This support is similar to the logging capabilities [built into GHC](https://www.haskell.org/ghc/blog/20190924-eventful-ghc.html).
657
837
658
-
### Liquid Haskell
659
838
660
-
Liquid Haskell requires an SMT solver on the path. We do not take care of installing one, thus, Liquid Haskell will not run until one is installed.
661
-
The recommended SMT solver is [z3](https://github.com/Z3Prover/z3). To run the tests, it is also required to have an SMT solver on the path, otherwise the tests will fail for Liquid Haskell.
0 commit comments