git.iko.soy/intellij-haskell
on master help sign in

IntelliJ plugin for Haskell

git clone ssh://git.iko.soy/intellij-haskell

logo IntelliJ plugin for Haskell

Join the chat at https://gitter.im/intellij-haskell/Lobby

When I was learning Haskell, I missed the nice features of IntelliJ IDEA. My first approach was to use default way of creating an IntelliJ plugin by defining a grammar and a lexer according to Haskell report. That didn't work out because I could not define all the recursion. Then I decided to use grammar and lexer definitions only for tokenizing and parsing Haskell code, and not for syntax checking the code. This is needed for syntax highlighting, all kinds of navigation and so on. Further Haskell language support is provided with the help of external tools.

This plugin depends mainly on Stack. It can create new Stack projects and import existing Stack projects.

GHC 8.2 and later is supported.

Any feedback is welcomed!!

Installing the plugin

You can install this plugin using the Jetbrains plugin repository: Settings/Plugins/Browse repositories/Intellij-Haskell

Installing latest beta of the plugin

To try out the latest beta version one can install the plugin by adding https://plugins.jetbrains.com/plugins/alpha/8258 as Custom plugin repository in Settings/Plugins/Browse repositories/Manage repositories.

Alternative way to install the latest beta version is to download intellij-haskell.zip from releases and apply Install plugin from disk in Settings/Plugins.

Features

Usage with hindent

When used with hindent, intellij-haskell automatically sets --indent-size as a command-line option in hindent from the Indent option in your project code style settings. It also automatically sets the --line-length command-line option from your Hard wrap at code style setting. This means that any .hindent.yaml files used for configuration will have these options overridden and may not fully work.

Getting started

Remarks

  1. IntelliJ's Build action is not (yet) implemented. Project is built when project is opened and when needed, e.g. library code is changed and user navigates to test code;
  2. About Haskell Project in Help menu shows which Haskell GHC/tools are used by plugin for project;
  3. GHC depends on libtinfo-dev. On Ubuntu you can install it with sudo apt-get install libtinfo-dev;
  4. Haskell tools depends on libgmp3-dev zlib1g-dev. On Ubuntu you can install them with sudo apt-get install libgmp3-dev zlib1g-dev;
  5. Cabal's internal libraries are not (yet) supported;
  6. Cabal's common stanzas are not (yet) supported;
  7. The Haskell tools are built in a IntelliJ sandbox with LTS-13. So they have no dependency with Stackage resolvers in your projects. After Stackage LTS-13 minor updates one can use Haskell>Update Haskell tools;
  8. Stack REPLs are running in the background. You can restart them by Haskell>Update Settings and Restart REPLs.

If you want to contribute to this project, read the contributing guideline.