on master help sign in
README: Add documentation for experimental ghcide support
commitce62bc7bd8862bfed99cb2638c8d4ce626c2b68d author3noch <eacameron@gmail.com> dateSat 18 Apr 2020, 22:48 (6 years ago) parent1cef28c
1 file changed+39
README.md+39
README.md+39
@@ -11,6 +11,9 @@ Obelisk provides an easy way to develop and deploy your [Reflex](https://github.
1111 - [Adding Packages](#adding-packages)
1212 - [Adding Package Overrides](#adding-package-overrides)
1313 - [Running over HTTPS](#running-over-https)
14+ - [IDE Support](#ide-support)
15+ - [Terminal-based feedback](#terminal-based-feedback)
16+ - [**Experimental** `ghcide` support](#experimental-ghcide-support)
1417- [Deploying](#deploying)
1518 - [Locally](#locally)
1619 - [Default EC2 Deployment](#default-ec2-deployment)
@@ -173,6 +176,42 @@ To run your app locally over HTTPS, update the protocol in `config/common/route`
173176
174177Since Obelisk generates a self-signed certificate for running HTTPS, the browser will issue a warning about using an invalid certificate. On Chrome, you can go to `chrome://flags/#allow-insecure-localhost` to enable invalid certificates for localhost.
175178
179+### IDE Support
180+
181+#### Terminal-based feedback
182+
183+Obelisk officially supports terminal-based feedback (akin to [`ghcid`](https://github.com/ndmitchell/ghcid)) in `ob run` and `ob watch`.
184+
185+#### **Experimental** `ghcide` support
186+
187+> **NOTE:** `ghcide` support is strictly **experimental** and **not officially supported**. There is no guarantee that it will work for you or that this support will be maintained over time.
188+
189+To try out the **experimental** [`ghcide`](https://github.com/digital-asset/ghcide) support:
190+
191+ * Install a `ghcide` plugin for your editor.
192+ * Add `__withGhcide = true;` to your Obelisk project's `default.nix` (inside the call to `project`). With this setting, `ob shell` will provide `ghcide` as well.
193+ * Add `hie-bios.sh` to the root of your project:
194+ ```shell
195+ cat > hie-bios.sh <<'EOF'
196+ #!/usr/bin/env bash
197+ source "$HOME/.bash_profile"; # NOTE: Some editors need help finding 'ob' and this assumes that `ob` is made available on your `$PATH` in `.bash_profile`
198+ ob internal export-ghci-configuration > "$HIE_BIOS_OUTPUT"
199+ EOF
200+ chmod +x hie-bios.sh
201+ ```
202+ * Add `hie.yaml` to the root of your project:
203+ ```shell
204+ echo 'cradle: { bios: { program: hie-bios.sh } }' > hie.yaml
205+ ```
206+ * Test the configuration with `ob shell ghcide`. Assuming your project compiles and works with `ghcide` otherwise, this should succeed.
207+ * Start your editor in a way that it can access the appropriate `ghcide`:
208+ * This can sometimes be achieved with `ob shell 'start my editor'`.
209+ * If you can't easily start your editor in a way that it inherits your shell, you may need customize how your `ghcide` plugin finds `ghcide` or create a custom `ghcide` replacement script that you install globally. For example, for Visual Studio Code on macOS adding a script called `ghcide` to your `PATH` like the one below will casue `ghcide` from each project's `ob shell` to be used:
210+ ```shell
211+ #!/usr/bin/env bash
212+ source "$HOME/.bash_profile" # NOTE: This assumes that `ob` is made available on your `$PATH` in `.bash_profile`
213+ ob shell "ghcide $@"
214+ ```
176215
177216## Deploying
178217