Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 111 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Haskell IDE Engine
# Haskell IDE Engine (HIE)
<img src="https://github.com/haskell/haskell-ide-engine/raw/master/logos/HIE_logo_512.png" width="256" style="margin:25px;" align="right"/>

[![License BSD3][badge-license]][license]
Expand All @@ -21,8 +21,11 @@ we talk to clients.__
- [Haskell IDE Engine](#haskell-ide-engine)
- [Features](#features)
- [Installation](#installation)
- Installation with [stack](#installation-with-stack) or [Nix](#installation-with-nix)
- [ArchLinux](#archlinux)
- [stack on Linux](#installation-with-stack-on-linux)
- [stack on Windows](#installation-with-stack-on-windows)
- [macOS](#installation-on-macos)
- [Nix](#installation-with-nix)
- [ArchLinux](#installation-on-archlinux)
- [Configuration](#configuration)
- [Editor Integration](#editor-integration)
- Using HIE with [VS Code](#using-hie-with-vs-code), [Sublime Text](#using-hie-with-sublime-text), [Vim/Neovim](#using-hie-with-vim-or-neovim), [Atom](#using-hie-with-atom), [Oni](#using-hie-with-oni), [Emacs](#using-hie-with-emacs), [Spacemacs](#using-hie-with-spacemacs) or [Spacemacs+Nix](#using-hie-with-spacemacs-on-nix-based-projects)
Expand Down Expand Up @@ -95,52 +98,109 @@ we talk to clients.__

## Installation

Note: The version on branch `hie-0.1.0.0` supports GHC 8.0.2. This is
not supported in master.
### Installation with stack on Linux

On linux derivatives you will need to do the equivalent of before building
To install HIE, you need stack version >= 1.7.1.

HIE builds from source code, so there's a couple of extra steps.

#### Linux pre-requirements

On Linux you will need install a couple of extra libraries (for Unicode ([ICU](http://site.icu-project.org/)) and [NCURSES](https://www.gnu.org/software/ncurses/)):

**Debian/Ubuntu**:

```bash
sudo apt install libicu-dev libtinfo-dev
```
**Fedora**:

```bash
sudo dnf install libicu-devel ncurses-devel
```
**ArchLinux**: see [below](#installation-on-archlinux).

### Getting the source for GHC 8.2.1 to 8.6.2
#### Download the source code

HIE builds from source code, so first,
```bash
git clone https://github.com/haskell/haskell-ide-engine --recursive
cd haskell-ide-engine
```

In order to support both stack and cabal, HIE requires `cabal-install`
as well. If it is not already installed, install it and update its package list:

```bash
$ git clone https://github.com/haskell/haskell-ide-engine --recursive
$ cd haskell-ide-engine
stack install cabal-install
cabal update
```
### Getting the source for GHC 8.0.2

HIE builds from source code, so first,
#### Choose your GHC version

The GHC version you are going to install HIE for depends on which version of GHC you are using for your project. If you don't have a current project there are two potential options:

1. The Nightly GHC version ([currently](https://www.stackage.org/nightly) 8.6.2)
2. The LTS GHC version (which is [currently](https://www.stackage.org/lts) 8.4.4)

By default in a stack project you will get the LTS version.

You can check which version of ghc you are using in your project by running the following at the root of your project:

```bash
$ git clone https://github.com/haskell/haskell-ide-engine
$ cd haskell-ide-engine
$ git checkout hie-0.1.0.0
$ git submodule update --init
stack ghc -- --version
```

### Installation with stack
You can install an specific version or [all available GHC versions](#install-all-available-ghc-versions).

To install HIE, you need Stack version >= 1.7.1
#### Install a specific GHC version 8.2.1 - 8.6.2

In order to support both stack and cabal, `hie` requires `cabal-install`
as well.
We will use the `make` tools here to wrap `stack install`. The preferred installation mechanism is via `make`, as it makes sure the repo is synced, installs the required cabal libraries if missing, and makes copies of the executables with suffixes to be able to tell them apart.

If it is not already installed, install it and update its package list. One of the ways is:
Install **Nightly** (and hoogle docs):

```bash
stack install cabal-install
cabal update
make hie-8.6.2
make build-doc-8.6.2
```

Install **LTS** (and hoogle docs):

```bash
make hie-8.4.4
make build-doc-8.4.4
```

This step can take more than 30 minutes, so grab a coffee and please be patient!

The available versions depend on the `stack-*.yaml` config files in the `haskell-ide-engine` directory.

#### For GHC 8.0.2

This is no longer supported on the HIE `master` branch, so you must switch to the `hie-0.1.0.0` branch:

```bash
git checkout hie-0.1.0.0
git submodule update --init
```
Then you can run `stack install`:

```bash
stack --stack-yaml=stack-8.0.2.yaml install
```

To install all supported GHC versions, name them as expected by the VS Code
plugin, and also build a local hoogle database, you need the `make` tool (on
Windows, see the further advice below). Use the command:
#### Install *all* available GHC versions

This is the simplest approach as it will install all GHC versions to match against any project versions you might have.

*Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient!

This will:

* install all supported GHC versions (8.2.1 - 8.6.2)
* name them as expected by the VS Code plugin
* build local hoogle docs for each version

For this you need the `make` tool (on Windows, see the further advice below). Use the command:

```bash
make build-all
Expand All @@ -155,41 +215,47 @@ Then add

to VS Code user settings.

Otherwise, do one of the following.
### Installation with stack on Windows

#### For GHC 8.6.2
To install HIE, you need stack version >= 1.7.1.

Using master
#### Download the source code

```bash
stack install
git clone https://github.com/haskell/haskell-ide-engine --recursive
cd haskell-ide-engine
```

#### For Other Versions of GHC

Using master
In order to support both stack and cabal, HIE requires `cabal-install`
as well. If it is not already installed, install it and update its package list:

```bash
stack --stack-yaml=stack-<VERSION>.yaml install
stack install cabal-install
cabal update
```

where `<VERSION>` correlates to one of the yaml files in the hie directory.
#### Install *all* available GHC versions

*Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient!

Note that GHC 8.0.2 is only available via branch `hie-0.1.0.0` and not
`master`, but otherwise the instructions above are the same.
This will:

### Installation on Windows
* install all supported GHC versions (8.2.1 - 8.6.2)
* name them as expected by the VS Code plugin
* build local hoogle docs for each version

The `Makefile` doesn't work on Windows due to several UNIX-specific things, such
`make` doesn't work on Windows due to several UNIX-specific things, such
as the `cp` command or extensionless executable names. Instead, a PowerShell
script is provided specifically for this purpose:

**Under PowerShell run:**
**PowerShell:**

```
./build-all.ps1
```

**Under cmd.exe run:**
**cmd.exe:**

```
powershell -ExecutionPolicy RemoteSigned -c ./build-all.ps1
```
Expand All @@ -198,11 +264,11 @@ powershell -ExecutionPolicy RemoteSigned -c ./build-all.ps1

In order to avoid problems with long paths on Windows you can do the following:

1. Edit the group policy: set "Enable Win32 long paths" to "Enabled". Works
only for Windows 10
1. Edit the group policy: set "Enable Win32 long paths" to "Enabled" (Works
only for Windows 10).

2. Clone the `haskell-ide-engine` to the root of your logical drive (e.g. to
`E:\hie`)
`C:\hie`)

### Installation on macOS

Expand All @@ -219,7 +285,7 @@ Alternatively, you can install from source with `make build`.
Follow the instructions at https://github.com/domenkozar/hie-nix


### ArchLinux
### Installation on ArchLinux

An [haskell-ide-engine-git](https://aur.archlinux.org/packages/haskell-ide-engine-git/) package is available on the AUR.

Expand Down