Provides support for the Elm programming language in IntelliJ and WebStorm.
- Code completion
- Go to declaration
- Go to symbol
- Find usages
- Type Inference and Type Checking (see below for more info)
- Rename refactoring
- Code folding
- Syntax highlighting
- Mark unresolvable references as errors
- 'Import' quick fix for unresolved references
- Structure view
- and more...
Watch the feature demo videos to learn more.
You can install the plugin from within the JetBrains IDE by going to Settings -> Plugins
and then searching for "Elm". Then click the Search in repositories
link.
If, however, you need to install a specific version of the plugin, you can get it from the releases page.
One major change since earlier versions of this plugin is that you must now attach your Elm project's JSON manifest
file (either elm.json
for Elm 0.19 or elm-package.json
for 0.18). The plugin will try to find this JSON file
on its own, but you may need to manually attach it if the magic fails.
See the elm-format integration instructions.
The plugin can perform type inference on arbitrary expressions in your program. Press ctrl-shift-p
to display the inferred type of the expression under the cursor/caret.
The plugin also performs type checking, marking incompatible types in red.
There are 2 limitations to the type system as currently implemented:
- it does not work if a function is missing a type annotation (typically not a problem)
- it does not work if type variables (such as
List a
orMaybe a
are involved)
We hope to remove the type variable limitation in the future.
The plugin does not currently provide any new-project templates. Until that work is done, the easiest way to create a new Elm project is to do everything from the command line using the standard Elm tools. If you're using Elm 0.19, this means:
- create a new directory for your project
- run
elm init
- open that directory in IntelliJ (or WebStorm, etc.)
- select the
src
directory in the IntelliJ project window - select
File -> New -> Elm Module
, call the new fileMain
- follow the prompt to setup the Elm toolchain by specifying the path to the directory which contains the Elm compiler
- follow the prompt to attach your project's
elm.json
file. - you're all set to write some code
Please note that the IntelliJ plugin does not install any of your project dependencies for you. It assumes that you have already installed them via the standard Elm command line tools.
This project heavily leverages the open-source work of other IntelliJ plugin developers:
- Code organization and testing utils based on the Rust plugin for IntelliJ.
- Lexer and Parser originally from Kamil Durkiewicz's elm-intellij-plugin.
- Offside-rule Lexer originally based on code from Alexander Kiel's idea-haskell plugin.
Thank you Kamil, Alexander, and the Rust plugin developers.
If this plugin improves your Elm development experience, and you want to give back, please consider making a donation (tax-deductible in the US) to the Narmada Vidya Peeth school in Jabalpur, India. This school provides a completely free education to 550 boys and girls, from ages 5 to 17. I have visited the school three times since 2012, and I can vouch for the worthiness of the cause.
Alternatively consider making donations to your favorite open-source developers and projects.