Haskeletor is a Haskell plugin for IntelliJ IDEA.
It supports code highlighting, code completion, compilation error highlighting — everything you need from an IDE for Haskell.
This plugin is based on the work of Rik van der Kleij and intellij-haskell contributors.
Read the contributor guide. Short version:
- To run the debug version of the IDE with the installed plugin, run the following shell command:
$ ./gradlew runIde - To build a local version of the plugin for subsequent installation into a compatible IDE, run the following shell command:
Then, grab a plugin distribution from the
$ ./gradlew buildPluginbuild/distributionsdirectory, and use the Install Plugin from Disk action to install it into your IDE.
- Install the latest version of Stack; use
stack upgradeto confirm you are on the latest version. - Set up the project:
- Make sure your Stack project builds without errors. Preferably by using:
stack build --test --haddock --no-haddock-hyperlink-source; - After your project is built successfully, import an existing project by:
- Inside IntelliJ use
File>New>Project from Existing Sources...from the IntelliJ menu; - In the
Welcome to IntelliJ IDEAdialog useOpen or Import Project;
- Inside IntelliJ use
- In the
New Projectwizard selectImport project from external modeland checkHaskell Stack; - On the next page of wizard configure
Project SDKby configuringHaskell Tool Stackby selecting a path tostackbinary, e.g./usr/local/bin/stack(you can usewhich stackon Linux or macOS orwhere stackon windows to find the path); - Finish wizard and project will be opened;
- Wizard will automatically configure which folders are sources, test and which to exclude;
- Plugin will automatically build Haskell Tools (HLint, Hoogle, Ormolu, and Stylish Haskell) to prevent incompatibility issues
- Check
Project structure>Project settings>Moduleswhich folders to exclude (like.stack-workanddist) and which folders areSourceandTest(normallysrcandtest); - Plugin will automatically download library sources. They will be added as source libraries to module(s).
- After changing the Cabal file and/or
stack.yamluseHaskell>Haskell>Update Settings and Restart REPLsto download missing library sources and update the project settings; - The
Event Logwill display what's going on in the background. Useful when something fails. It's disabled by default. It can be enabled by checking theHaskell Logcheckbox in theEvent Log>SettingsorSettings>Appearance & Behavior>Notifications;
- Make sure your Stack project builds without errors. Preferably by using:
- IntelliJ's Build action is not (yet) implemented. Project is built when the project is opened and when needed, e.g. when library code is changed and the user navigates to test code;
About Haskell ProjectinHelpmenu shows which Haskell GHC/tools are used by the plugin for the project;- GHC depends on
libtinfo-dev. On Ubuntu you can install it withsudo apt-get install libtinfo-dev; - Haskell tools depend on
libgmp3-dev zlib1g-dev. On Ubuntu you can install them withsudo apt-get install libgmp3-dev zlib1g-dev; - Cabal's internal libraries are not (yet) supported;
- Cabal's common stanzas are not (yet) supported;
- The Haskell tools are built in an IntelliJ sandbox with LTS-16. So they have no dependency on Stackage resolvers in your projects. After Stackage LTS-13 minor updates one can use
Haskell>Update Haskell tools; - Stack REPLs are running in the background. You can restart them by
Haskell>Update Settings and Restart REPLs.
- Syntax highlighting;
- Error/warning highlighting;
- Haskell Problems View. This tool window displays GHC messages for the currently edited files;
- Find usages of identifiers;
- Resolve references to identifiers;
- Code completion;
- In-place rename identifiers;
- View type info from (selected) expression;
- View sticky type info;
- View expression info;
- View quick documentation;
- View quick definition;
- Structure view;
- Goto to declaration (called
Navigate>Declarationin IntelliJ menu); - Navigate to declaration (called
Navigate>Classin IntelliJ menu); - Navigate to an identifier (called
Navigate>Symbolin IntelliJ menu); - Goto instance declaration (called
Navigate>Instance Declarationin IntelliJ menu); - Navigate to declaration or identifier powered by Hoogle (called
Navigate>Navigation by Hooglein IntelliJ menu); - Inspection by HLint;
- Quick fixes for HLint suggestions;
- Show error action to view formatted messages. Useful in case message consists of multiple lines (Ctrl-F10, Meta-F10 on Mac OSX);
- Intention actions to add language extension (depends on compiler error), add top-level type signature (depends on compiler warning);
- Intention action to select which module to import if the identifier is not in scope;
- Default code formatting by
ormolu. Alternatively bystylish-Haskell. - Code completion for project module names, language extensions, and package names in Cabal file;
- Running REPL, tests, and executables via
Run Configurations; - Smart code completion on typed holes (since GHC 8.4);
The project is distributed under the terms of the Apache 2.0 license (unless a particular file states otherwise).
The license indication in the project's sources is compliant with the REUSE specification v3.3.
Copyright holders:
- 2000-2015 JetBrains s.r.o.
- 2012-2014 Sergey Ignatov
- 2014-2022 intellij-haskell contributors https://github.com/rikvdkleij/intellij-haskell
- 2014-2022 Rik van der Kleij
- 2024-2026 Friedrich von Never friedrich@fornever.me
- 2026 haskeletor contributors https://github.com/ForNeVeR/haskeletor