Skip to content

Instantly share code, notes, and snippets.

@tonybaines
Last active January 5, 2019 19:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tonybaines/9b4380ca82264a3b992201b46b5849c7 to your computer and use it in GitHub Desktop.
Save tonybaines/9b4380ca82264a3b992201b46b5849c7 to your computer and use it in GitHub Desktop.
IntelliJ IDEA Elm Setup

Configuring and Using IntelliJ IDEA for basic Elm development

Assumes an elm toolchain installed through NPM

npm install -g elm elm-test elm-format

Versions

  • Elm 0.18
  • IntelliJ IDEA 2017.3.4

IntelliJ Plugins

IntelliJ Configuration

Modules (assuming existing sources)

  • Project Structure (Ctrl-Alt-Shift-S)
    • Modules
      • Add -> Import Module
      • Select source directory
      • Create module from existing sources
      • Next, Next, Finish
    • Repeat for tests sub-folder
      • Needs to be a separate module or compilation fails

External Tools

  • Settings (Ctrl-Alt-S)
    • Tools -> External Tools
Program Arguments Working directory
elm-reactor $ModuleFileDir$
elm-format --elm-version 0.18 --yes "$FilePath$" $ProjectFileDir$
elm-test $FileDirName$/$FileName$ $ModuleFileDir$/..

File Watchers

  • Settings (Ctrl-Alt-S)
    • Tools -> File Watchers
Program Arguments
elm-format --elm-version 0.18 --yes "$FilePath$"

Untick Auto-save edited files to trigger the watcher

Key Bindings

  • Settings (Ctrl-Alt-S)
    • Keymap -> External Tools
      • elm-format Alt+E, Alt+L
      • elm-reactor Alt+E, Alt+R
      • elm-test Alt+E, Alt+T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment