diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2019-09-20 11:09:23 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-09-24 21:09:23 -0400 |
commit | 218c5dbfbd60a416588e1b952c167ebd18ef9c56 (patch) | |
tree | 26e8b3e8d4df3a40350fb177bdf1406173c61616 | |
parent | ed520678404ade3b5886be3f3c41a4bf41cf231d (diff) | |
download | haskell-218c5dbfbd60a416588e1b952c167ebd18ef9c56.tar.gz |
Add ghcide configuration files
This commit adds three new files
1. A hie.yaml file to the project root which specifies to IDEs how to
set up the correct environment for loading GHC. This currently
specifies to call the `./hadrian/hie-bios` script.
2. A `hie.yaml` file for the hadrian subcomponent, which uses the
`cabal` cradle type.
2. The `./hadrian/hie-bios` script which supplies the correct arguments
for an IDE to start a session.
With these two files it is possible to run
```
ghcide compiler/
```
and successfully load all the modules for use in the IDE.
or
```
ghcide --cwd hadrian/ src/
```
to test loading all of Hadrian's modules.
Closes #17194
-rwxr-xr-x | hadrian/hie-bios | 7 | ||||
-rw-r--r-- | hadrian/hie.yaml | 5 | ||||
-rw-r--r-- | hie.yaml | 5 |
3 files changed, 17 insertions, 0 deletions
diff --git a/hadrian/hie-bios b/hadrian/hie-bios new file mode 100755 index 0000000000..741537ea34 --- /dev/null +++ b/hadrian/hie-bios @@ -0,0 +1,7 @@ +#! /usr/bin/env bash + +# When run, this program will output a list of arguments which are necessary to +# load the GHC library component into GHCi. The program is used by `ghcide` in +# order to automatically set up the correct GHC API session for a project. +echo $(TERM=dumb CABFLAGS=-v0 $PWD/hadrian/build.cabal.sh tool-args -q --build-root=.hie-bios --flavour=ghc-in-ghci) -ighc ghc/Main.hs + diff --git a/hadrian/hie.yaml b/hadrian/hie.yaml new file mode 100644 index 0000000000..e9d68d4318 --- /dev/null +++ b/hadrian/hie.yaml @@ -0,0 +1,5 @@ +# This is a IDE configuration file which tells IDEs such as `ghcide` how +# to set up a GHC API session for this project. +# +# The format is documented here - https://github.com/mpickering/hie-bios +cradle: {cabal: {component: "exe:hadrian"}} diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 0000000000..d23f66c1c4 --- /dev/null +++ b/hie.yaml @@ -0,0 +1,5 @@ +# This is a IDE configuration file which tells IDEs such as `ghcide` how +# to set up a GHC API session for this project. +# +# The format is documented here - https://github.com/mpickering/hie-bios +cradle: {bios: {program: "./hadrian/hie-bios"}} |