When I was learning Haskell, I missed the nice features of IntelliJ IDEA. My first approach was to use the 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.2 and later is supported.
Any feedback is welcomed!!
You can install this plugin using the Jetbrains plugin repository:
Settings
/Plugins
/Browse repositories
/IntelliJ-Haskell`
To try out the latest beta version one can install the plugin by adding https://plugins.jetbrains.com/plugins/alpha/8258
as a custom plugin repository in Settings
/Plugins
/Browse repositories
/Manage repositories
.
An 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
.
Navigate
>Declaration
in IntelliJ menu);Navigate
>Class
in IntelliJ menu);Navigate
> Symbol
in IntelliJ menu);Navigate
>Instance Declaration
in IntelliJ menu);Navigate
>Navigation by Hoogle
in IntelliJ menu);ormolu
. Alternatively by stylish-Haskell
.Run Configurations
;Settings
/Plugins
/Browse repositories
/IntelliJ-Haskell`. Make sure no other Haskell plugin is installed in IntelliJ;stack upgrade
to confirm you are on the latest version.stack build --test --haddock --no-haddock-hyperlink-source
;File
>New
>Project from Existing Sources...
from the IntelliJ menu;Welcome to IntelliJ IDEA
dialog use Open or Import Project
;New Project
wizard select Import project from external model
and check Haskell Stack
;Project SDK
by configuring Haskell Tool Stack
by selecting a path to stack
binary, e.g. /usr/local/bin/stack
(you can use which stack
on Linux or macOS or where stack
on windows to find the path);Project structure
>Project settings
>Modules
which folders to exclude (like .stack-work
and dist
) and which folders are Source
and Test
(normally src
and test
);stack.yaml
use Haskell
>Haskell
>Update Settings and Restart REPLs
to download missing library sources and update the project settings;Event Log
will display what's going on in the background. Useful when something fails. It's disabled by default.Haskell Log
checkbox in the Event Log
>Settings
or Settings
>Appearance & Behavior
>Notifications
;About Haskell Project
in Help
menu shows which Haskell GHC/tools are used by the plugin for the project;libtinfo-dev
. On Ubuntu you can install it with sudo apt-get install libtinfo-dev
;libgmp3-dev zlib1g-dev
. On Ubuntu you can install them with sudo apt-get install libgmp3-dev zlib1g-dev
;Haskell
>Update Haskell tools
;Haskell
>Update Settings and Restart REPLs
.If you want to contribute to this project, read the contributing guideline.