summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2019-09-20 11:09:23 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2019-09-24 09:00:19 +0100
commite96e5646863b1171959d09a03d04528106e7bfe0 (patch)
tree948014b8caa589bc0f3c3d63edb2767f19b6b9b8
parent1b7e1d31fee4176608e46d45ddc195e313eed978 (diff)
downloadhaskell-wip/ghcide-support.tar.gz
Add ghcide configuration fileswip/ghcide-support
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-xhadrian/hie-bios7
-rw-r--r--hadrian/hie.yaml5
-rw-r--r--hie.yaml5
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"}}