google / google/hrepl

Feature request: Only print GHCi flags without opening the REPL

Open
#11 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
51
Forks
9
PR merge metrics
No merged PRs in 30d

Description

## Feature
Add an option for `hrepl` to only print the relevant flags to GHCi for loading the specified range of targets. This should probably exclude flags that are only required for `hrepl` specifics, e.g. for the ghci script that `hrepl` defines.

## Use-case
The use-case I have in mind is to use `hrepl` in a [`hie-bios` cradle](https://github.com/mpickering/hie-bios/) to enable [`ghcide`](https://github.com/digital-asset/ghcide#readme) to load rules_haskell projects.

`hie-bios` has a `bios` cradle that takes a program that will write all required GHC flags to a file specified by the `$HIE_BIOS_OUTPUT` environment variable. `hrepl` could be used as that program. Furthermore, `hie-bios` could be extended with a dedicated Bazel cradle (reviving the [currently disabled one](https://github.com/mpickering/hie-bios/blob/5311e704f5745ac330cdb67ddf9e760b89ade9e0/src/HIE/Bios/Cradle.hs#L527)).

An example use-case could look like this:
```
cradle:
multi:
- path: "./src"
config: { cradle: {bazel: {targets: ["//src/..."]}} }
- path: "./test"
config: { cradle: {bazel: {targets: ["//test/..."]}} }
```
Assuming wild-card support in `hrepl` (or the `bazel` cradle) and multi-cradle support in `ghcide`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.